mirror of
https://github.com/zadam/trilium.git
synced 2025-12-22 07:14:24 +01:00
client: refactor
This commit is contained in:
parent
0de05ed16e
commit
32f7ae1edd
@ -90,11 +90,11 @@ export default class NoteWrapperWidget extends FlexContainer<BasicWidget> {
|
||||
|
||||
async entitiesReloadedEvent({ loadResults }: EventData<"entitiesReloaded">) {
|
||||
// listening on changes of note.type and CSS class
|
||||
|
||||
const LABELS_CAUSING_REFRESH = ["cssClass", "language", "viewType", "color"];
|
||||
const noteId = this.noteContext?.noteId;
|
||||
if (
|
||||
loadResults.isNoteReloaded(noteId) ||
|
||||
loadResults.getAttributeRows().find((attr) => attr.type === "label" && ["cssClass", "language", "viewType", "color"].includes(attr.name ?? "") && attributeService.isAffecting(attr, this.noteContext?.note))
|
||||
loadResults.getAttributeRows().find((attr) => attr.type === "label" && LABELS_CAUSING_REFRESH.includes(attr.name ?? "") && attributeService.isAffecting(attr, this.noteContext?.note))
|
||||
) {
|
||||
this.refresh();
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user