Fix site ID and ntfy topic failing to restore from LocalStorage
Signed-off-by: AKP <tom@tdpain.net>
This commit is contained in:
parent
73bfd8ce8c
commit
5c73978163
3 changed files with 19 additions and 13 deletions
|
@ -23,4 +23,18 @@ function showSuccessElement(elem) {
|
|||
show(successIndicator)
|
||||
}
|
||||
|
||||
const state = {}
|
||||
const state = {}
|
||||
|
||||
window.onload = () => {
|
||||
let x = localStorage.getItem("site")
|
||||
if (x === undefined) {
|
||||
return
|
||||
}
|
||||
siteIDInput.value = x
|
||||
|
||||
x = localStorage.getItem("ntfy_topic")
|
||||
if (x === undefined) {
|
||||
return
|
||||
}
|
||||
ntfyTopicInput.value = x
|
||||
}
|
|
@ -1,8 +1,8 @@
|
|||
const selectSiteBlock = document.getElementById("select_site");
|
||||
const siteIDInput = document.getElementById("select_site__site_id_input")
|
||||
|
||||
{
|
||||
const nextButton = document.getElementById("select_site__next_button")
|
||||
const siteIDInput = document.getElementById("select_site__site_id_input")
|
||||
|
||||
siteIDInput.addEventListener("change", () => {
|
||||
if (siteIDInput.value.trim() === "") {
|
||||
|
@ -13,11 +13,7 @@ const selectSiteBlock = document.getElementById("select_site");
|
|||
})
|
||||
|
||||
document.addEventListener("load", () => {
|
||||
const x = localStorage.getItem("site")
|
||||
if (x === undefined) {
|
||||
return
|
||||
}
|
||||
siteIDInput.value = x
|
||||
|
||||
})
|
||||
|
||||
nextButton.addEventListener("click", () => {
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
const submitBlock = document.getElementById("submit")
|
||||
const ntfyTopicInput = document.getElementById("submit__ntfy_topic")
|
||||
|
||||
{
|
||||
const nextButton = document.getElementById("submit__next_button")
|
||||
const ntfyTopicInput = document.getElementById("submit__ntfy_topic")
|
||||
|
||||
ntfyTopicInput.addEventListener("change", () => {
|
||||
if (ntfyTopicInput.value.trim() === "") {
|
||||
|
@ -13,11 +13,7 @@ const submitBlock = document.getElementById("submit")
|
|||
})
|
||||
|
||||
document.addEventListener("load", () => {
|
||||
const x = localStorage.getItem("ntfy_topic")
|
||||
if (x === undefined) {
|
||||
return
|
||||
}
|
||||
ntfyTopicInput.value = x
|
||||
|
||||
})
|
||||
|
||||
nextButton.addEventListener("click", () => {
|
||||
|
|
Reference in a new issue