Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
fix load results isEmpty method
zadam114017147fb6
diff --git a/db/schema.sql b/db/schema.sqlindex 8c766571fb..f5024a097f 100644--- a/db/schema.sql+++ b/db/schema.sql@@ -3,8 +3,6 @@ CREATE TABLE IF NOT EXISTS "source_ids" (`utcDateCreated` TEXT NOT NULL,PRIMARY KEY(`sourceId`));-CREATE INDEX IDX_source_ids_utcDateCreated- on source_ids (utcDateCreated);CREATE TABLE IF NOT EXISTS "api_tokens"(apiTokenId TEXT PRIMARY KEY NOT NULL,@@ -59,6 +57,8 @@ CREATE INDEX `IDX_note_revisions_utcDateCreated` ON `note_revisions` (`utcDateCrCREATE INDEX `IDX_note_revisions_utcDateLastEdited` ON `note_revisions` (`utcDateLastEdited`);CREATE INDEX `IDX_note_revisions_dateCreated` ON `note_revisions` (`dateCreated`);CREATE INDEX `IDX_note_revisions_dateLastEdited` ON `note_revisions` (`dateLastEdited`);+CREATE INDEX IDX_source_ids_utcDateCreated+ on source_ids (utcDateCreated);CREATE TABLE IF NOT EXISTS "notes" (`noteId` TEXT NOT NULL,`title` TEXT NOT NULL DEFAULT "note",diff --git a/src/public/javascripts/services/load_results.js b/src/public/javascripts/services/load_results.jsindex 8cdbaaa0a2..678afdc336 100644--- a/src/public/javascripts/services/load_results.js+++ b/src/public/javascripts/services/load_results.js@@ -18,7 +18,7 @@ export default class LoadResults {this.options = [];}- addNote(noteId, sourceId) {+ addNote(noteId, sourceId) {console.log("Adding", noteId, sourceId);this.noteIdToSourceId[noteId] = this.noteIdToSourceId[noteId] || [];if (!this.noteIdToSourceId[noteId].includes(sourceId)) {@@ -102,12 +102,12 @@ export default class LoadResults {}isEmpty() {- return Object.keys(this.noteIdToSourceId).length > 0- || this.branches.length > 0- || this.attributes.length > 0- || this.noteReorderings.length > 0- || this.noteRevisions.length > 0- || this.contentNoteIdToSourceId.length > 0- || this.options.length > 0;+ return Object.keys(this.noteIdToSourceId).length === 0+ && this.branches.length === 0+ && this.attributes.length === 0+ && this.noteReorderings.length === 0+ && this.noteRevisions.length === 0+ && this.contentNoteIdToSourceId.length === 0+ && this.options.length === 0;}}\ No newline at end of file