-
Notifications
You must be signed in to change notification settings - Fork 1.6k
fix: embedded modal not closing after connecting #5367
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| --- | ||
| '@reown/appkit-scaffold-ui': patch | ||
| 'pay-test-exchange': patch | ||
| '@reown/appkit-adapter-bitcoin': patch | ||
| '@reown/appkit-adapter-ethers': patch | ||
| '@reown/appkit-adapter-ethers5': patch | ||
| '@reown/appkit-adapter-solana': patch | ||
| '@reown/appkit-adapter-ton': patch | ||
| '@reown/appkit-adapter-wagmi': patch | ||
| '@reown/appkit': patch | ||
| '@reown/appkit-utils': patch | ||
| '@reown/appkit-cdn': patch | ||
| '@reown/appkit-cli': patch | ||
| '@reown/appkit-codemod': patch | ||
| '@reown/appkit-common': patch | ||
| '@reown/appkit-controllers': patch | ||
| '@reown/appkit-core': patch | ||
| '@reown/appkit-experimental': patch | ||
| '@reown/appkit-pay': patch | ||
| '@reown/appkit-polyfills': patch | ||
| '@reown/appkit-siwe': patch | ||
| '@reown/appkit-siwx': patch | ||
| '@reown/appkit-testing': patch | ||
| '@reown/appkit-ui': patch | ||
| '@reown/appkit-universal-connector': patch | ||
| '@reown/appkit-wallet': patch | ||
| '@reown/appkit-wallet-button': patch | ||
| --- | ||
|
|
||
| Fixed an issue where the embedded modal did not close properly after connecting |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,6 +7,7 @@ import { | |
| ApiController, | ||
| ChainController, | ||
| ConnectorController, | ||
| CoreHelperUtil, | ||
| ModalController, | ||
| ModalUtil, | ||
| OptionsController, | ||
|
|
@@ -246,8 +247,13 @@ export class W3mModalBase extends LitElement { | |
| const isSwitchingNamespace = ChainController.state.isSwitchingNamespace | ||
| const isInProfileView = RouterController.state.view === 'ProfileWallets' | ||
|
|
||
| const shouldClose = !caipAddress && !isSwitchingNamespace && !isInProfileView | ||
| if (shouldClose) { | ||
| const shouldCloseModal = !caipAddress && !isSwitchingNamespace && !isInProfileView | ||
|
|
||
| const hasPreviouslyDisconnected = !CoreHelperUtil.getPlainAddress(this.caipAddress) | ||
| const shouldCloseEmbeddedModal = | ||
| this.enableEmbedded && Boolean(caipAddress) && hasPreviouslyDisconnected | ||
|
|
||
| if (shouldCloseModal || shouldCloseEmbeddedModal) { | ||
| ModalController.close() | ||
| } | ||
|
Comment on lines
247
to
258
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we apply something like this? think we should have more descriptive boolean names if we are introducing new conditions
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe |
||
|
|
||
|
|
||
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.
Is this a canary from the fix currently being implemented?
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.
yep