bug: fetch zapper when indexedDb is not available
This commit is contained in:
parent
5f0bd9699f
commit
840e2ff400
@ -98,20 +98,21 @@ export class UserProfileCache {
|
|||||||
const existing = this.get(m.pubkey);
|
const existing = this.get(m.pubkey);
|
||||||
const refresh = existing && existing.created === m.created && existing.loaded < m.loaded;
|
const refresh = existing && existing.created === m.created && existing.loaded < m.loaded;
|
||||||
if (!existing || existing.created < m.created || refresh) {
|
if (!existing || existing.created < m.created || refresh) {
|
||||||
|
// fetch zapper key
|
||||||
|
const lnurl = m.lud16 || m.lud06;
|
||||||
|
if (lnurl) {
|
||||||
|
try {
|
||||||
|
const svc = new LNURL(lnurl);
|
||||||
|
await svc.load();
|
||||||
|
m.zapService = svc.zapperPubkey;
|
||||||
|
} catch {
|
||||||
|
console.debug("Failed to load LNURL for zapper pubkey", lnurl);
|
||||||
|
}
|
||||||
|
// ignored
|
||||||
|
}
|
||||||
|
|
||||||
this.#cache.set(m.pubkey, m);
|
this.#cache.set(m.pubkey, m);
|
||||||
if (db.ready) {
|
if (db.ready) {
|
||||||
// fetch zapper key
|
|
||||||
const lnurl = m.lud16 || m.lud06;
|
|
||||||
if (lnurl) {
|
|
||||||
try {
|
|
||||||
const svc = new LNURL(lnurl);
|
|
||||||
await svc.load();
|
|
||||||
m.zapService = svc.zapperPubkey;
|
|
||||||
} catch {
|
|
||||||
console.debug("Failed to load LNURL for zapper pubkey", lnurl);
|
|
||||||
}
|
|
||||||
// ignored
|
|
||||||
}
|
|
||||||
await db.users.put(m);
|
await db.users.put(m);
|
||||||
this.#diskCache.add(m.pubkey);
|
this.#diskCache.add(m.pubkey);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user