mirror of
https://github.com/zadam/trilium.git
synced 2025-10-20 15:19:01 +02:00
feat(views/table): refresh on attribute change
This commit is contained in:
parent
0fb0be4ffc
commit
44ce6a5169
@ -8,7 +8,7 @@ import server from "../../../services/server.js";
|
||||
import type { GridApi, GridState } from "ag-grid-community";
|
||||
import SpacedUpdate from "../../../services/spaced_update.js";
|
||||
import branches from "../../../services/branches.js";
|
||||
import type { CommandListenerData } from "../../../components/app_context.js";
|
||||
import type { CommandListenerData, EventData } from "../../../components/app_context.js";
|
||||
import type { Attribute } from "../../../services/attribute_parser.js";
|
||||
|
||||
const TPL = /*html*/`
|
||||
@ -184,5 +184,17 @@ export default class TableView extends ViewMode<StateInfo> {
|
||||
console.log("Save attributes", this.newAttribute);
|
||||
}
|
||||
|
||||
onEntitiesReloaded({ loadResults }: EventData<"entitiesReloaded">): boolean | void {
|
||||
// Refresh if promoted attributes get changed.
|
||||
if (loadResults.getAttributeRows().find(attr =>
|
||||
attr.type === "label" &&
|
||||
attr.name?.startsWith("label:") &&
|
||||
attributes.isAffecting(attr, this.parentNote))) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user