fix: make sure all tests are passing

This commit is contained in:
thecodrr
2022-06-08 10:26:19 +05:00
parent 3300b019a2
commit c660ef6721
3 changed files with 3 additions and 17 deletions

View File

@@ -31,7 +31,8 @@ export default class Topic {
const noteNotebook = notebooks.find((nb) => nb.id === this._notebookId);
const noteHasNotebook = !!noteNotebook;
const noteHasTopic = noteNotebook.topics.indexOf(topic.id) > -1;
const noteHasTopic =
noteHasNotebook && noteNotebook.topics.indexOf(topic.id) > -1;
if (noteHasNotebook && !noteHasTopic) {
// 1 note can be inside multiple topics
noteNotebook.topics.push(topic.id);