From 3bb97385c95f5638d4844843cb2ae455c1e39b70 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sat, 10 Jan 2026 13:17:44 +0200 Subject: [PATCH] fix(client): a case where inheritance boolean is not correct --- apps/client/src/services/attributes.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/apps/client/src/services/attributes.ts b/apps/client/src/services/attributes.ts index 2f0a1202d..0b156dcf3 100644 --- a/apps/client/src/services/attributes.ts +++ b/apps/client/src/services/attributes.ts @@ -46,19 +46,19 @@ export async function setRelation(noteId: string, name: string, value: string = export async function setBooleanWithInheritance(note: FNote, labelName: string, value: boolean) { const actualValue = note.isLabelTruthy(labelName); if (actualValue === value) return; + const hasInheritedValue = !note.hasOwnedLabel(labelName) && note.hasLabel(labelName); - if (value) { - if (note.getOwnedLabelValue(labelName) === "false") { - // Remove the override so that the inherited true takes effect. - removeOwnedLabelByName(note, labelName); - } else { + if (hasInheritedValue) { + if (value) { setLabel(note.noteId, labelName, ""); + } else { + // Label is inherited - override to false. + setLabel(note.noteId, labelName, "false"); } - } else if (note.hasOwnedLabel(labelName)) { - removeOwnedLabelByName(note, labelName); + } else if (value) { + setLabel(note.noteId, labelName, ""); } else { - // Label is inherited - override to false. - setLabel(note.noteId, labelName, "false"); + removeOwnedLabelByName(note, labelName); } }