diff options
Diffstat (limited to 'src/features')
| -rw-r--r-- | src/features/messages.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/features/messages.js b/src/features/messages.js index f98df3a..f558bce 100644 --- a/src/features/messages.js +++ b/src/features/messages.js @@ -209,7 +209,7 @@ export function messagesFeature(ctx) { saveEmoji(); } const emojiRelays = (extra = []) => [...new Set([...extra, ...zapRelays(), ...DM_RELAYS, ...STOCK_RELAYS])]; - async function fetchPack(ref) { + async function fetchEmojiPack(ref) { // (not fetchPack: that name is the follow packs' further down, and a second declaration wins) const evs = await queryOn(emojiRelays(ref.relays), { kinds: [EMOJI_SET_KIND], authors: [ref.pubkey], '#d': [ref.identifier] }, 6000).catch(() => []); const newest = (evs || []).sort((a, b) => b.created_at - a.created_at)[0]; return newest ? parseEmojiSet(newest) : null; @@ -230,7 +230,7 @@ export function messagesFeature(ctx) { const addr = packAddr(ref.pubkey, ref.identifier); if (hasPack(addr)) { toast(t('msgEmojiPackHave')); return true; } ui.emojiBusy = true; render(); - const pack = await fetchPack(ref); + const pack = await fetchEmojiPack(ref); ui.emojiBusy = false; if (!pack) { toast(t('msgEmojiPackBad')); render(); return false; } holdPack(pack); @@ -287,7 +287,7 @@ export function messagesFeature(ctx) { let changed = false; for (const addr of want) { if (s.packs[addr]) continue; - const pack = await fetchPack(parsePackAddr(addr)); + const pack = await fetchEmojiPack(parsePackAddr(addr)); if (pack) { holdPack(pack); changed = true; } else s.unfetched.push(addr); } // the list's own order wins over arrival order @@ -7726,7 +7726,6 @@ export function messagesFeature(ctx) { async function reactTo(ev, emoji) { const id = await requireIdentity(); - const relays = await noteRelaysFor(ev); const partial = { kind: 7, content: emoji || '❤️', created_at: Math.floor(Date.now() / 1000), tags: [['e', ev.id], ['p', ev.pubkey], ...reactEmojiTags(emoji), CLIENT_TAG], @@ -7735,7 +7734,8 @@ export function messagesFeature(ctx) { myReactEv.set(ev.id, evt.id); noteEvent(evt); // on screen before the relays answer render(); - publishOn(relays, evt).catch(() => {}); + // (the author's relay list can take seconds to find: it isn't needed to paint) + publishOn(await noteRelaysFor(ev), evt).catch(() => {}); } // A boost is kind 6 carrying the note it repeats (NIP-18). |
