fix: pass protocol and identifier directly to chat window

Fix 'undefined protocol' error when opening chat from event menu.
Instead of passing raw nevent as args, directly pass the parsed
protocol and identifier props that ChatViewer expects.
This commit is contained in:
Claude
2026-01-19 11:42:08 +00:00
parent 0fa74c239c
commit 854871a5c1

View File

@@ -197,12 +197,21 @@ export function EventMenu({ event }: { event: NostrEvent }) {
if (event.kind === 1) {
const seenRelaysSet = getSeenRelays(event);
const relays = seenRelaysSet ? Array.from(seenRelaysSet) : [];
const nevent = nip19.neventEncode({
id: event.id,
author: event.pubkey,
relays: relays,
// Open chat with NIP-10 thread protocol
addWindow("chat", {
protocol: "nip-10",
identifier: {
type: "thread",
value: {
id: event.id,
relays,
author: event.pubkey,
kind: event.kind,
},
relays,
},
});
addWindow("chat", { args: [nevent] });
}
};