-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: duplicate pop-up authn Iframe #367
Conversation
🦋 Changeset detectedLatest commit: 0c7bd6c The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@@ -163,7 +163,8 @@ export default class EthereumProvider | |||
name, | |||
display_name, | |||
network_type, | |||
wallet_web_url: this._blocto.walletServer, | |||
wallet_web_url: this.injectedWalletServer || | |||
ETH_ENV_WALLET_SERVER_MAPPING[blocto_service_environment], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when executing this method for the first time, this._blocto.walletServer
is an empty string.
use this.injectedWalletServer || ETH_ENV_WALLET_SERVER_MAPPING[blocto_service_environment]
to avoid setting an empty string for the first time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe extract this.injectedWalletServer || ETH_ENV_WALLET_SERVER_MAPPING[blocto_service_environment]
as a constant, and we can just reuse this constant in L155 and L166? This can provide a clearer expression for the relation here, which helps people maintaining the code to understand the code better
@@ -443,6 +444,7 @@ export default class EthereumProvider | |||
case 'wallet_addEthereumChain': { | |||
return this.loadSwitchableNetwork(payload?.params || []); | |||
} | |||
case 'eth_blockNumber': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uniswap makes periodic calls to eth_blockNumber
, adding eth_blockNumber
to avoid falling into the default switch block that requires user to be connected (L527)
cd79ae9
to
a6cf160
Compare
a6cf160
to
897e8ce
Compare
@@ -163,7 +163,8 @@ export default class EthereumProvider | |||
name, | |||
display_name, | |||
network_type, | |||
wallet_web_url: this._blocto.walletServer, | |||
wallet_web_url: this.injectedWalletServer || | |||
ETH_ENV_WALLET_SERVER_MAPPING[blocto_service_environment], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe extract this.injectedWalletServer || ETH_ENV_WALLET_SERVER_MAPPING[blocto_service_environment]
as a constant, and we can just reuse this constant in L155 and L166? This can provide a clearer expression for the relation here, which helps people maintaining the code to understand the code better
Summary
this._blocto
updating operation in ethereum provider's#getBloctoProperties()
isomorphicInitialize()
to avoid repeat add eventlistener's callback fnaction.update({ ... })
in event callback fn to avoid repeat open iframemethod: 'eth_blockNumber
&method: 'web3_clientVersion'
to non-connected switch blocks to prevent the authn Iframe from opening when uniswap callseth_blockNumber
&web3_clientVersion
.Related Links
Asana:https://app.asana.com/0/1201812548509877/1205974827065486/f
Checklist
Prerequisite/Related Pull Requests