mirror of
https://github.com/purrgrammer/grimoire.git
synced 2026-04-12 08:27:27 +02:00
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:
@@ -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] });
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user