Skip to content

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

web: fix color check status not updating in properties

Abdullah Atta675324f6afd6
diff --git a/apps/web/src/stores/editor-store.ts b/apps/web/src/stores/editor-store.ts
index 14f634478..23b3bc0f4 100644
--- a/apps/web/src/stores/editor-store.ts
+++ b/apps/web/src/stores/editor-store.ts
@@ -365,6 +365,25 @@ class EditorStore extends BaseStore<EditorStore> {
color: undefined
});
}
+ } else if (
+ event.type === "unlink" &&
+ event.reference.type === "note" &&
+ event.types.includes("color")
+ ) {
+ for (const session of sessions) {
+ const ids =
+ "id" in event.reference
+ ? [event.reference.id]
+ : event.reference.ids;
+ if (
+ session.type === "new" ||
+ (!ids.includes(session.id) && !ids.includes(session.note.id))
+ )
+ continue;
+ updateSession(session.id, undefined, {
+ color: undefined
+ });
+ }
}
}
if (clearIds.length > 0) closeSessions(...clearIds);