Skip to content

Commit

Permalink
Merge pull request #260 from reown-com/fix/email-login
Browse files Browse the repository at this point in the history
fix: changed init config of frame provider
  • Loading branch information
ignaciosantise authored Oct 10, 2024
2 parents 391ad4e + d5c55ed commit 1b2e0ae
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
18 changes: 18 additions & 0 deletions .changeset/heavy-hairs-suffer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
'@reown/appkit-wallet-react-native': patch
'@reown/appkit-auth-ethers-react-native': patch
'@reown/appkit-auth-wagmi-react-native': patch
'@reown/appkit-coinbase-ethers-react-native': patch
'@reown/appkit-coinbase-wagmi-react-native': patch
'@reown/appkit-common-react-native': patch
'@reown/appkit-core-react-native': patch
'@reown/appkit-ethers-react-native': patch
'@reown/appkit-ethers5-react-native': patch
'@reown/appkit-scaffold-react-native': patch
'@reown/appkit-scaffold-utils-react-native': patch
'@reown/appkit-siwe-react-native': patch
'@reown/appkit-ui-react-native': patch
'@reown/appkit-wagmi-react-native': patch
---

fix: changed init config of email provider
9 changes: 3 additions & 6 deletions packages/wallet/src/AppKitFrameConstants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,9 @@ export const AppKitFrameConstants = {
EMAIL: 'EMAIL',

FRAME_MESSAGES_HANDLER: `
const iframe = document.getElementById("frame-mobile-sdk");
iframe.onload = () => {
window.addEventListener('message', ({ data, origin }) => {
window.ReactNativeWebView.postMessage(JSON.stringify({ ...data, origin }))
})
}
window.addEventListener('message', ({ data, origin }) => {
window.ReactNativeWebView.postMessage(JSON.stringify({ ...data, origin }))
})
`,

APP_SWITCH_NETWORK: '@w3m-app/SWITCH_NETWORK',
Expand Down
1 change: 1 addition & 0 deletions packages/wallet/src/AppKitFrameProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,7 @@ export class AppKitFrameProvider {
// console.log('📡 sending', strEvent); // eslint-disable-line no-console
const send = `
(function() {
let iframe = document.getElementById('frame-mobile-sdk');
iframe.contentWindow.postMessage(${strEvent}, '*');
})()
`;
Expand Down

0 comments on commit 1b2e0ae

Please sign in to comment.