mirror of
https://github.com/zadam/trilium.git
synced 2025-11-03 20:06:08 +01:00
chore(react): not reacting to deleted note labels
This commit is contained in:
@@ -300,7 +300,11 @@ export function useNoteLabel(note: FNote | undefined | null, labelName: string):
|
|||||||
useTriliumEvent("entitiesReloaded", ({ loadResults }) => {
|
useTriliumEvent("entitiesReloaded", ({ loadResults }) => {
|
||||||
for (const attr of loadResults.getAttributeRows()) {
|
for (const attr of loadResults.getAttributeRows()) {
|
||||||
if (attr.type === "label" && attr.name === labelName && attributes.isAffecting(attr, note)) {
|
if (attr.type === "label" && attr.name === labelName && attributes.isAffecting(attr, note)) {
|
||||||
setLabelValue(attr.value ?? null);
|
if (!attr.isDeleted) {
|
||||||
|
setLabelValue(attr.value);
|
||||||
|
} else {
|
||||||
|
setLabelValue(null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user