Skip to content

Build your personal knowledge base with Trilium Notes

feat(geo_map): react to changes in hierarchy

Elian Doran7a0199595d78
diff --git a/src/public/app/widgets/type_widgets/geo_map.ts b/src/public/app/widgets/type_widgets/geo_map.ts
index a4b7d57073..5bb060ce95 100644
--- a/src/public/app/widgets/type_widgets/geo_map.ts
+++ b/src/public/app/widgets/type_widgets/geo_map.ts
@@ -330,6 +330,14 @@ export default class GeoMapTypeWidget extends TypeWidget {
}
entitiesReloadedEvent({ loadResults }: EventData<"entitiesReloaded">) {
+ // If any of the children branches are altered.
+ if (loadResults.getBranchRows().find((branch) => branch.parentNoteId === this.noteId)) {
+ this.#reloadMarkers();
+ return;
+ }
+
+ // If any of note has its location attribute changed.
+ // TODO: Should probably filter by parent here as well.
const attributeRows = loadResults.getAttributeRows();
if (attributeRows.find((at) => at.name === LOCATION_ATTRIBUTE)) {
this.#reloadMarkers();