fix: pass proper ProtocolIdentifier object when opening group chats

GroupLink was passing a string identifier instead of a properly structured
ProtocolIdentifier object, causing chat window to fail opening.

Fixed to pass:
{
  protocol: "nip-29",
  identifier: {
    type: "group",
    value: groupId,
    relays: [relayUrl]
  }
}

This matches the expected ChatViewer props interface and allows the
NIP-29 adapter to properly resolve the conversation with the group relay.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Alejandro Gómez
2026-01-11 22:06:37 +01:00
parent 64b97e4926
commit 6b6605ded0

View File

@@ -57,9 +57,15 @@ export function GroupLink({
: undefined;
const handleClick = () => {
// Open chat with NIP-29 format: relay'group-id
const identifier = `${relayUrl}'${groupId}`;
addWindow("chat", { protocol: "nip-29", identifier });
// Open chat with properly structured ProtocolIdentifier
addWindow("chat", {
protocol: "nip-29",
identifier: {
type: "group",
value: groupId,
relays: [relayUrl],
},
});
};
const displayName = formatGroupIdForDisplay(groupName);