From 95eca37ebcbbcf619dd1d49c7a52acc955ec1d9d Mon Sep 17 00:00:00 2001 From: quenousimporte Date: Mon, 2 Oct 2023 12:33:45 +0200 Subject: [PATCH] refactor: function to set as saved --- main.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/main.js b/main.js index 12e1c0f..ed6af28 100644 --- a/main.js +++ b/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(); } }