Skip to content

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

fix: do not add duplicate note ids to tags

thecodrr7808419059e2
diff --git a/packages/core/collections/tags.js b/packages/core/collections/tags.js
index 300589c14..42923b079 100644
--- a/packages/core/collections/tags.js
+++ b/packages/core/collections/tags.js
@@ -49,6 +49,9 @@ export default class Tags extends Collection {
let tag = { ...oldTag, title: tagTitle };
let id = tag.id || getId();
let notes = tag.noteIds || [];
+
+ if (notes.find((id) => id === noteId)) return id;
+
let deletedIds = tag.deletedIds || [];
tag = {
type: "tag",