web: fix assigning a color removes that color from all other notes

This commit is contained in:
Abdullah Atta
2024-03-20 07:24:29 +05:00
parent 63be4088a5
commit 357d872362

View File

@@ -111,7 +111,7 @@ class NoteStore extends BaseStore<NoteStore> {
};
setColor = async (colorId: string, isChecked: boolean, ...ids: string[]) => {
await db.relations.from({ type: "color", id: colorId }, "note").unlink();
await db.relations.to({ type: "note", ids }, "color").unlink();
if (!isChecked) {
for (const id of ids) {
await db.relations.add(