mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-29 00:20:04 +01:00
mobile: fix note assigned to multiple colors
This commit is contained in:
committed by
Abdullah Atta
parent
8089f7e181
commit
cd62069b9b
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user