yup, lume is very solid now

This commit is contained in:
Ren Amamiya
2023-08-29 16:11:17 +07:00
parent 2914c54a47
commit 91e50efb1a
20 changed files with 177 additions and 88 deletions

View File

@@ -37,13 +37,15 @@ export default class TauriAdapter implements NDKCacheAdapter {
public async setEvent(event: NDKEvent): Promise<void> {
const nostrEvent = await event.toNostrEvent();
const key = `${nostrEvent.pubkey}:${nostrEvent.kind}`;
if (event.kind !== 3) {
const key = `${nostrEvent.pubkey}:${nostrEvent.kind}`;
return new Promise((resolve) => {
Promise.all([this.store.set(key, JSON.stringify(nostrEvent))]).then(() =>
resolve()
);
});
return new Promise((resolve) => {
Promise.all([this.store.set(key, JSON.stringify(nostrEvent))]).then(() =>
resolve()
);
});
}
}
public async saveCache(): Promise<void> {