fix: clone public identity fields before cross-frame signer handoff

This commit is contained in:
archipelago
2026-10-05 21:11:03 -04:00
parent 041f1fa2d3
commit 6f098cd9c2
4 changed files with 108 additions and 3 deletions
+13 -1
View File
@@ -74,7 +74,19 @@ function hideSigner(delay = 0) {
}
function sendIdentity(identity: SelectedIdentity) {
parentPost({ type: 'archipelago:signer-identity', identity })
// The picker emits a Vue reactive object. Browser postMessage cannot clone
// that proxy: sending it closes the picker, then throws before the broker
// can hide, leaving a blank full-screen surface. Send public scalar fields
// explicitly, also keeping any unrelated identity metadata out of the app.
const publicIdentity: SelectedIdentity = {
id: identity.id,
name: identity.name,
did: identity.did,
pubkey: identity.pubkey,
nostr_pubkey: identity.nostr_pubkey,
nostr_npub: identity.nostr_npub,
}
parentPost({ type: 'archipelago:signer-identity', identity: publicIdentity })
}
const bridge = useNostrBridge(getStoredIdentity, {