clean up and refactor open graph
This commit is contained in:
@@ -31,12 +31,26 @@ export default class TauriAdapter implements NDKCacheAdapter {
|
||||
const event = await this.store.get(result as string);
|
||||
|
||||
if (event) {
|
||||
console.log('cache hit: ', result);
|
||||
const ndkEvent = new NDKEvent(subscription.ndk, JSON.parse(event as string));
|
||||
subscription.eventReceived(ndkEvent, undefined, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (filter.ids) {
|
||||
for (const id of filter.ids) {
|
||||
const key = id;
|
||||
const event = await this.store.get(key);
|
||||
|
||||
if (event) {
|
||||
console.log('cache hit: ', id);
|
||||
const ndkEvent = new NDKEvent(subscription.ndk, JSON.parse(event as string));
|
||||
subscription.eventReceived(ndkEvent, undefined, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public async setEvent(event: NDKEvent): Promise<void> {
|
||||
Reference in New Issue
Block a user