mirror of
https://github.com/hoornet/vega.git
synced 2026-06-30 14:08:34 -07:00
Fix DMs not loading — use subscribe instead of fetchEvents for gift wraps
NDK's fetchEvents silently returns 0 results for kind 1059 (gift wrap) events despite relays having them. Replaced with manual subscribe + eose listener which correctly receives the events.
This commit is contained in:
@@ -155,13 +155,17 @@ function ThreadPanel({
|
||||
setSending(true);
|
||||
setSendError(null);
|
||||
try {
|
||||
console.log("[DM-UI] sending to", partnerPubkey.slice(0, 8));
|
||||
await sendDM(partnerPubkey, content);
|
||||
console.log("[DM-UI] send completed, re-fetching thread...");
|
||||
setText("");
|
||||
// Re-fetch thread to include the sent message
|
||||
const updated = await fetchDMThread(myPubkey, partnerPubkey);
|
||||
console.log("[DM-UI] re-fetch got", updated.length, "messages");
|
||||
setMessages(updated);
|
||||
textareaRef.current?.focus();
|
||||
} catch (err) {
|
||||
console.error("[DM-UI] send failed:", err);
|
||||
setSendError(String(err));
|
||||
} finally {
|
||||
setSending(false);
|
||||
|
||||
Reference in New Issue
Block a user