diff --git a/main.js b/main.js index 72fd0cf..bb1266a 100644 --- a/main.js +++ b/main.js @@ -1264,14 +1264,15 @@ function migratelegacystorage() var legacy = localStorage.getItem("data"); if (legacy) { - var legacy = JSON.parse(legacy); + alert("Old data model detected. Click ok to migrate, or close app.") + legacy = JSON.parse(legacy); var index = {}; - legacy.reverse().forEach(note => + legacy.reverse().forEach( (note, i) => { var guid = genguid(); localStorage.setItem(guid, note.content); note.header = indexheader(note.content); - note.lastchanged = Date.now(); + note.lastchanged = i; delete note.content; index[guid] = note; });