fix load results isEmpty method

This commit is contained in:
zadam
2020-03-15 17:18:50 +01:00
parent 2cc0442ef2
commit 114017147f
2 changed files with 10 additions and 10 deletions

View File

@@ -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;
}
}