diff --git a/main.js b/main.js index 68fca63..c2554e6 100644 --- a/main.js +++ b/main.js @@ -26,6 +26,7 @@ var codelanguages = ["xml", "js", "sql"]; var currentnote = null; var fileindex = 0; var workerid = null; +var inactivityid = null; var backup = ""; var localdata = null; var saved = true; @@ -1877,6 +1878,11 @@ function postpone() }); } +function inactivityalert() +{ + alert("Last save was one hour ago. Should you refresh?"); +} + async function save() { clearTimeout(workerid); @@ -1949,6 +1955,8 @@ async function save() { console.log("...data saved on server"); saved = true; + clearTimeout(inactivityid); + inactivityid = setTimeout(inactivityalert, 60 * 60 * 1000); }) .catch(remotecallfailed) .finally(() =>