Skip to content

Open-source and local-first Slack and Notion alternative that puts you in control of your data

Add note updated event handler in node-tree-get query handler

Hakan Shehu5e18e802afbf
diff --git a/apps/desktop/src/main/queries/nodes/node-tree-get.ts b/apps/desktop/src/main/queries/nodes/node-tree-get.ts
index dd72a7c7..1aedc480 100644
--- a/apps/desktop/src/main/queries/nodes/node-tree-get.ts
+++ b/apps/desktop/src/main/queries/nodes/node-tree-get.ts
@@ -45,6 +45,21 @@ export class NodeTreeGetQueryHandler
};
}
+ if (
+ event.type === 'node_updated' &&
+ event.accountId === input.accountId &&
+ event.workspaceId === input.workspaceId
+ ) {
+ const node = output.find((n) => n.id === event.node.id);
+ if (node) {
+ const newResult = await this.handleQuery(input);
+ return {
+ hasChanges: true,
+ result: newResult,
+ };
+ }
+ }
+
if (
event.type === 'node_deleted' &&
event.accountId === input.accountId &&