Compare commits

...

1 Commits

Author SHA1 Message Date
Abdullah Atta
10d7e46342 core: add support for archiving notes 2023-06-03 23:06:21 +05:00
2 changed files with 10 additions and 2 deletions

View File

@@ -133,6 +133,7 @@ export default class Notes extends Collection {
localOnly: !!note.localOnly,
conflicted: !!note.conflicted,
readonly: !!note.readonly,
archived: !!note.archived,
dateCreated: note.dateCreated,
dateEdited: note.dateEdited || note.dateCreated || Date.now(),
@@ -165,8 +166,11 @@ export default class Notes extends Collection {
* @returns {any[]}
*/
get all() {
const items = this._collection.getItems();
return items;
return this._collection.getItems();
}
get archived() {
return this.all.filter((item) => item.archived === true);
}
get pinned() {

View File

@@ -217,6 +217,10 @@ export default class Note {
return this._toggle("pinned");
}
archive() {
return this._toggle("archived");
}
readonly() {
return this._toggle("readonly");
}