From 9b88fed15c23bc39777ed5fdfb3c5162f6acdd51 Mon Sep 17 00:00:00 2001 From: Kieran Date: Wed, 8 Feb 2023 11:36:06 +0000 Subject: [PATCH] bug: never put empty profile --- src/Nostr/System.ts | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/Nostr/System.ts b/src/Nostr/System.ts index 470eba99..3b01275f 100644 --- a/src/Nostr/System.ts +++ b/src/Nostr/System.ts @@ -211,14 +211,13 @@ export class NostrSystem { ); console.debug("No profiles: ", couldNotFetch); if (couldNotFetch.length > 0) { - await this.UserDb!.bulkPut( - couldNotFetch.map((a) => { - return { - pubkey: a, - loaded: new Date().getTime(), - } as MetadataCache; - }) - ); + let updates = couldNotFetch.map((a) => { + return { + pubkey: a, + loaded: new Date().getTime(), + }; + }).map(a => this.UserDb!.update(a.pubkey, a)); + await Promise.all(updates); } } }