Skip to content

Commit

Permalink
fix: return nostrWalletConnectUrl in nwc connection success event and…
Browse files Browse the repository at this point in the history
… message
  • Loading branch information
rolznz committed Jan 18, 2025
1 parent 50057ba commit fe726f9
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions frontend/src/screens/apps/AppCreated.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,20 +61,24 @@ function AppCreatedInternal() {
}
// dispatch a success event which can be listened to by the opener or by the app that embedded the webview
// this gives those apps the chance to know the user has enabled the connection
const nwcEvent = new CustomEvent("nwc:success", { detail: {} });
const nwcEvent = new CustomEvent("nwc:success", {
detail: {
nostrWalletConnectUrl: pairingUri,
},
});
window.dispatchEvent(nwcEvent);

// notify the opener of the successful connection
if (window.opener) {
window.opener.postMessage(
{
type: "nwc:success",
payload: { success: true },
nostrWalletConnectUrl: pairingUri,
},
"*"
);
}
}, [appstoreApp]);
}, [appstoreApp, pairingUri]);

if (!createAppResponse) {
return <Navigate to="/apps/new" />;
Expand Down

0 comments on commit fe726f9

Please sign in to comment.