diff --git a/main.js b/main.js index 6cb1a44..e61ff2d 100644 --- a/main.js +++ b/main.js @@ -312,6 +312,11 @@ var snippets = [ insert: "x " + (new Date).toISOString().substring(0, 10) + " " }]; +function genguid() +{ + return crypto.randomUUID(); +} + function purgetodo() { if (currentistodo() && confirm("Remove completed tasks?")) { @@ -1180,7 +1185,7 @@ function loadstorage() { notesindex = {}; // todo: refactor in "add new note" - var guid = crypto.randomUUID(); + var guid = genguid(); var content = defaultheaders(); var item = { title: timestamp(), @@ -1306,7 +1311,7 @@ function migratelegacystorage() var index = {}; legacy.forEach(note => { - var guid = crypto.randomUUID(); + var guid = genguid(); localStorage.setItem(guid, note.content); note.tags = gettags(note.content); delete note.content;