Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

fix: getting colored notes caused a crash

thecodrrc6c00c61c994
diff --git a/packages/core/collections/notes.js b/packages/core/collections/notes.js
index 4563ad07c..837946644 100644
--- a/packages/core/collections/notes.js
+++ b/packages/core/collections/notes.js
@@ -127,9 +127,9 @@ export default class Notes extends Collection {
}
colored(color) {
- return this._db.colors
- .notes(color)
- .map((id) => this._collection.getItem(id));
+ const color = this._db.colors.tag(tagId);
+ if (!color || color.noteIds.length <= 0) return [];
+ return color.noteIds.map((id) => this._collection.getItem(id));
}
/**