chore(react): not reacting to deleted note labels

This commit is contained in:
Elian Doran
2025-08-30 19:33:32 +03:00
parent 5570f3bdcf
commit 2689b22674

View File

@@ -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);
}
}
}
});