Skip to content

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

Fix an await in database service init

Hakan Shehu4e7828e91818
diff --git a/apps/desktop/src/main/data/database-service.ts b/apps/desktop/src/main/data/database-service.ts
index 62875d95..6fbc6b48 100644
--- a/apps/desktop/src/main/data/database-service.ts
+++ b/apps/desktop/src/main/data/database-service.ts
@@ -35,7 +35,7 @@ class DatabaseService {
public async getWorkspaceDatabase(
userId: string
): Promise<Kysely<WorkspaceDatabaseSchema>> {
- this.waitForInit();
+ await this.waitForInit();
if (this.workspaceDatabases.has(userId)) {
return this.workspaceDatabases.get(userId)!;
diff --git a/apps/desktop/src/main/services/sync-service.ts b/apps/desktop/src/main/services/sync-service.ts
index d563436c..de76ef13 100644
--- a/apps/desktop/src/main/services/sync-service.ts
+++ b/apps/desktop/src/main/services/sync-service.ts
@@ -344,8 +344,6 @@ class SyncService {
.where('nodes.id', 'is', null)
.execute();
- console.log('missingNodes', missingNodes);
-
if (missingNodes.length === 0) {
return;
}
@@ -383,8 +381,6 @@ class SyncService {
}
);
- console.log('missing node data', data);
-
await nodeService.replaceTransactions(
userId,
node.node_id,