fix: filter out deleted notes when getting tag notes

This commit is contained in:
thecodrr
2021-12-08 23:22:41 +05:00
parent fda5e0c84b
commit 2a9f57bacf

View File

@@ -174,8 +174,8 @@ export default class Notes extends Collection {
const tag = this._db[collection].tag(tagId);
if (!tag || tag.noteIds.length <= 0) return [];
const array = tag.noteIds.reduce((arr, id) => {
const item = this._collection.getItem(id);
if (item) arr.push(item);
const item = this.note(id);
if (item) arr.push(item.data);
return arr;
}, []);
return sort(array).desc((note) => note.dateCreated);