refactor guid gen
This commit is contained in:
parent
090c04eedd
commit
47f0907e77
9
main.js
9
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;
|
||||
|
|
Loading…
Reference in New Issue