From c3dae9fa80016a10ad50c90ea1c0780fc3774e7c Mon Sep 17 00:00:00 2001 From: Ammar Ahmed Date: Wed, 28 Feb 2024 12:49:41 +0500 Subject: [PATCH] mobile: fix note assigned to multiple colors --- apps/mobile/app/components/properties/color-tags.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/apps/mobile/app/components/properties/color-tags.tsx b/apps/mobile/app/components/properties/color-tags.tsx index 6d98e8d6e..d26b87ef1 100644 --- a/apps/mobile/app/components/properties/color-tags.tsx +++ b/apps/mobile/app/components/properties/color-tags.tsx @@ -51,7 +51,15 @@ const ColorItem = ({ item, note }: { item: Color; note: Note }) => { }, [item, note.id]); const toggleColor = async () => { - await db.relations.unlinkOfType("color", [item.id]); + await db.relations + .to( + { + type: "note", + id: note.id + }, + "color" + ) + .unlink(); if (!isLinked) { await db.relations.add(item, note);