refactor: function to set as saved

This commit is contained in:
quenousimporte 2023-10-02 12:33:45 +02:00
parent ca29382b55
commit 95eca37ebc
1 changed files with 9 additions and 4 deletions

13
main.js
View File

@ -1989,6 +1989,11 @@ function postpone()
});
}
function setsaved()
{
saved = true;
}
function save()
{
clearTimeout(workerid);
@ -1998,13 +2003,13 @@ function save()
settings = JSON.parse(md.value);
savesettings();
loadsettings();
saved = true;
setsaved();
return;
}
else if (currentnote.title == "pgpkeys")
{
localStorage.setItem("pgpkeys", md.value);
saved = true;
setsaved();
return;
}
@ -2053,7 +2058,7 @@ function save()
.then(() =>
{
console.log("...data saved on server");
saved = true;
setsaved();
})
.catch(remotecallfailed)
.finally(() =>
@ -2072,7 +2077,7 @@ function save()
}
else
{
saved = true;
setsaved();
}
}