change messages

This commit is contained in:
quenousimporte 2024-02-16 09:39:19 +01:00
parent 682a18132d
commit e8c5d38b3a
1 changed files with 10 additions and 3 deletions

11
main.js
View File

@ -1305,7 +1305,7 @@ function migratelegacystorage()
var legacy = localStorage.getItem("data"); var legacy = localStorage.getItem("data");
if (legacy) if (legacy)
{ {
alert("Old data model detected. Click ok to migrate, or close app.") alert("Hey! I am about to migrate your notes to the brand new data model. No worries, I will keep a backup somewhere in case things go wrong. Take a deep breath, and click ok when you're ready.")
legacy = JSON.parse(legacy); legacy = JSON.parse(legacy);
var index = {}; var index = {};
legacy.reverse().forEach( (note, i) => legacy.reverse().forEach( (note, i) =>
@ -1365,10 +1365,17 @@ function fetch()
.then(filecontent => .then(filecontent =>
{ {
if (!filecontent) if (!filecontent)
{
if (confirm("No remote index found. Init remote now?"))
{ {
pushall().then(resolve); pushall().then(resolve);
} }
else else
{
resolve();
}
}
else
{ {
var localindex = JSON.parse(localStorage.getItem("index")); var localindex = JSON.parse(localStorage.getItem("index"));
var remoteindex = JSON.parse(filecontent); var remoteindex = JSON.parse(filecontent);
@ -2813,7 +2820,7 @@ function bind(title, content, pos)
{ {
if (workerid) if (workerid)
{ {
showtemporaryinfo("current note not yet serialized"); showtemporaryinfo("Cannot open '" + title + "' because current note not yet serialized");
return; return;
} }