From d9c6ad3a038dc1bea1fdf2cb80c01a40995a3751 Mon Sep 17 00:00:00 2001 From: pablof7z Date: Sat, 1 Feb 2025 13:21:00 +0000 Subject: [PATCH] make loading of known event ids sync --- ndk-mobile/src/cache-adapter/sqlite.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ndk-mobile/src/cache-adapter/sqlite.ts b/ndk-mobile/src/cache-adapter/sqlite.ts index c3ab5a21..2f622db7 100644 --- a/ndk-mobile/src/cache-adapter/sqlite.ts +++ b/ndk-mobile/src/cache-adapter/sqlite.ts @@ -117,16 +117,15 @@ export class NDKCacheAdapterSqlite implements NDKCacheAdapter { }); } - // console.log(`[${Date.now()}] [SQLITE] Cache adapter ready`); this.ready = true; this.locking = true; // load all the event timestamps - const events = await this.db.getAllAsync(`SELECT id, created_at FROM events`) as {id: string, created_at: number}[]; + const events = this.db.getAllSync(`SELECT id, created_at FROM events`) as {id: string, created_at: number}[]; for (const event of events) { this.knownEventTimestamps.set(event.id, event.created_at); } - + await this.loadUnpublishedEvents(); Promise.all(this.pendingCallbacks.map((f) => {