Skip to content

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

Fix delete entry handler

Hakan Shehu42d3cdca242b
diff --git a/apps/desktop/src/main/services/entry-service.ts b/apps/desktop/src/main/services/entry-service.ts
index bc875336..694e010b 100644
--- a/apps/desktop/src/main/services/entry-service.ts
+++ b/apps/desktop/src/main/services/entry-service.ts
@@ -394,16 +394,16 @@ class EntryService {
throw new Error('User not found');
}
- const root = await fetchEntry(workspaceDatabase, entryId);
- if (!root) {
- throw new Error('Entry not found');
- }
-
const entry = await fetchEntry(workspaceDatabase, entryId);
if (!entry) {
throw new Error('Entry not found');
}
+ const root = await fetchEntry(workspaceDatabase, entry.root_id);
+ if (!root) {
+ throw new Error('Root not found');
+ }
+
if (
!canDeleteEntry({
user: {