refactor: function to set as saved
This commit is contained in:
parent
ca29382b55
commit
95eca37ebc
13
main.js
13
main.js
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue