fix deleted visibility

This commit is contained in:
quenousimporte 2024-02-07 22:26:22 +01:00
parent 7edb42ef83
commit 33bbafaf7f
1 changed files with 7 additions and 15 deletions

22
main.js
View File

@ -1368,18 +1368,6 @@ function init()
}
}
function getorcreate(guid, content)
{
var note = getnote(guid);
/*if (!note)
{
note = {title: title, content: content, pos: content.length};
localdata.push(note)
}*/
return note;
}
function queryremote(params)
{
return new Promise( (apply, failed) => {
@ -1552,9 +1540,13 @@ function loadnext()
function sortedlist(deleted)
{
// todo: fix deleted stuff
deleted = deleted === true;
return Object.values(metadata).filter(i => !deleted || i.deleted).sort( (i,j) => j.lastchanged - i.lastchanged);
return Object
.values(metadata)
.filter(i =>
{
return deleted === true ? i.deleted : !i.deleted;
})
.sort( (i,j) => j.lastchanged - i.lastchanged);
}
function grep(needle)