Skip to content

Commit

Permalink
feat: always re-emit display uri event (#1066)
Browse files Browse the repository at this point in the history
  • Loading branch information
abretonc7s authored Oct 8, 2024
1 parent a9c7116 commit 57cce89
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
3 changes: 0 additions & 3 deletions packages/devnext/src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ const WithSDKConfig = ({ children }: { children: React.ReactNode }) => {
socketServer,
infuraAPIKey,
useDeeplink,
_experimentalDeeplinkProtocol,
checkInstallationImmediately,
} = useSDKConfig();

Expand All @@ -38,7 +37,6 @@ const WithSDKConfig = ({ children }: { children: React.ReactNode }) => {
'0x539': process.env.NEXT_PUBLIC_PROVIDER_RPCURL ?? '',
},
extensionOnly: false,
_experimentalDeeplinkProtocol,
logging: {
developerMode: true,
remoteLayer: true,
Expand Down Expand Up @@ -76,7 +74,6 @@ export default function App({ Component, pageProps }: AppProps) {
<SDKConfigProvider
initialSocketServer={process.env.NEXT_PUBLIC_COMM_SERVER_URL}
initialInfuraKey={process.env.NEXT_PUBLIC_INFURA_API_KEY}
_initialExperimentalDeeplinkProtocol={false}
debug={true}
>
<WithSDKConfig>
Expand Down
9 changes: 7 additions & 2 deletions packages/sdk/src/provider/initializeMobileProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,14 @@ const initializeMobileProvider = async ({
executeRequest: any,
debugRequest: boolean,
) => {
const provider = Ethereum.getProvider();

if (initializationOngoing) {
// Always re-emit the display_uri event
provider.emit('display_uri', {
uri: remoteConnection?.state.qrcodeLink || '',
});

// make sure the active modal is displayed
remoteConnection?.showActiveModal();

Expand All @@ -149,8 +156,6 @@ const initializeMobileProvider = async ({
// Also check that socket is connected -- otherwise it would be in inconherant state.
const socketConnected = remoteConnection?.isConnected();

const provider = Ethereum.getProvider();

let selectedAddress: string | null = null;
let connectedAccounts: string[] | null = null;
let chainId: string | null = null;
Expand Down

0 comments on commit 57cce89

Please sign in to comment.