A fully open source & end-to-end encrypted note taking alternative to Evernote.
TypeScript asp-net-coredotnet-coreelectronfosshacktoberfestnote-managmentnote-takingnote-taking-appnotebooknotesnotes-appopen-sourceopensourceprivacyproductivityreactreact-nativereactjsself-hosted
core: include notebook notes in total notes count
Abdullah Atta9804c1fbb13a
diff --git a/packages/core/collections/relations.js b/packages/core/collections/relations.jsindex beaf00843..e12f91c21 100644--- a/packages/core/collections/relations.js+++ b/packages/core/collections/relations.js@@ -92,6 +92,17 @@ export default class Relations extends Collection {return this.resolve(relations, "from");}+ /**+ * Count number of from -> to relations+ * @param {ItemReference} reference+ * @param {string} type+ */+ count(reference, type) {+ return this.all.filter(+ (a) => compareItemReference(a.from, reference) && a.to.type === type+ ).length;+ }+get raw() {return this._collection.getRaw();}diff --git a/packages/core/models/notebook.js b/packages/core/models/notebook.jsindex 7244e6765..45e717559 100644--- a/packages/core/models/notebook.js+++ b/packages/core/models/notebook.js@@ -35,7 +35,7 @@ export default class Notebook {for (const topic of this._notebook.topics) {count += this._db.notes.topicReferences.count(topic.id);}- return count;+ return count + this._db.relations.count(this._notebook, "note");}get title() {