Skip to content

Commit 1e03046

Browse files
fix proxy
1 parent e6960da commit 1e03046

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

packages/web/src/worker/db/SharedWASQLiteConnection.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,9 @@ export class SharedWASQLiteConnection implements AsyncDatabaseConnection {
9090

9191
if (clientIds.size == 0) {
9292
logger.debug(`Closing connection to ${this.options}.`);
93+
const connection = this.connection;
9394
dbMap.delete(dbFilename);
94-
return this.connection.close();
95+
await connection.close();
9596
}
9697
logger.debug(`Connection to ${dbFilename} not closed yet due to active clients.`);
9798
return;

packages/web/src/worker/db/WorkerWASQLiteConnection.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ export function proxyWASQLiteConnection(connection: AsyncDatabaseConnection): As
2222
}
2323

2424
export class WorkerWASQLiteConnection extends WASqliteConnection {
25-
registerOnTableChange(callback: OnTableChangeCallback): Promise<() => void> {
25+
async registerOnTableChange(callback: OnTableChangeCallback): Promise<() => void> {
2626
// Proxy the callback remove function
27-
return Comlink.proxy(super.registerOnTableChange(callback));
27+
return Comlink.proxy(await super.registerOnTableChange(callback));
2828
}
2929
}

0 commit comments

Comments
 (0)