Skip to content

Build your personal knowledge base with Trilium Notes

chore(react): not reacting to deleted note labels

Elian Doran2689b22674b1
diff --git a/apps/client/src/widgets/react/hooks.tsx b/apps/client/src/widgets/react/hooks.tsx
index 4a9f24cebd..6b1d7af68a 100644
--- a/apps/client/src/widgets/react/hooks.tsx
+++ b/apps/client/src/widgets/react/hooks.tsx
@@ -300,7 +300,11 @@ export function useNoteLabel(note: FNote | undefined | null, labelName: string):
useTriliumEvent("entitiesReloaded", ({ loadResults }) => {
for (const attr of loadResults.getAttributeRows()) {
if (attr.type === "label" && attr.name === labelName && attributes.isAffecting(attr, note)) {
- setLabelValue(attr.value ?? null);
+ if (!attr.isDeleted) {
+ setLabelValue(attr.value);
+ } else {
+ setLabelValue(null);
+ }
}
}
});