wip, broke something with serializer

This commit is contained in:
nai-degen 2023-10-12 15:13:55 -05:00
parent 00402c8310
commit b8cc5e563e
1 changed files with 6 additions and 0 deletions

View File

@ -86,9 +86,15 @@ export class FirebaseKeyStore<K extends Key> implements KeyStore<K> {
return this.scheduleFlush();
}
if (this.pendingUpdates.size === 0) {
this.log.debug("No pending key updates to flush.");
return this.scheduleFlush();
}
const updates: Record<string, Partial<SerializedKey>> = {};
this.pendingUpdates.forEach((v, k) => (updates[k] = v));
this.pendingUpdates.clear();
console.log(updates);
await this.keysRef.update(updates);