Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .changeset/sour-zoos-try.md
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
3 changes: 2 additions & 1 deletion apps/demo/lib/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,6 @@ export const NAMESPACE_NETWORK_IDS_MAP: Record<ChainNamespace, (string | number)
polkadot: [],
cosmos: [],
sui: [],
stacks: []
stacks: [],
ton: []
}
18 changes: 9 additions & 9 deletions apps/demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@
"@radix-ui/react-switch": "1.2.6",
"@radix-ui/react-tabs": "1.1.13",
"@radix-ui/react-tooltip": "1.2.8",
"@reown/appkit": "1.8.8",
"@reown/appkit-adapter-bitcoin": "1.8.8",
"@reown/appkit-adapter-ethers": "1.8.8",
"@reown/appkit-adapter-solana": "1.8.8",
"@reown/appkit-common": "1.8.8",
"@reown/appkit-controllers": "1.8.8",
"@reown/appkit-scaffold-ui": "1.8.8",
"@reown/appkit-ui": "1.8.8",
"@reown/appkit": "1.8.14-embedded-mode-fix.0",
"@reown/appkit-adapter-bitcoin": "1.8.14-embedded-mode-fix.0",
"@reown/appkit-adapter-ethers": "1.8.14-embedded-mode-fix.0",
"@reown/appkit-adapter-solana": "1.8.14-embedded-mode-fix.0",
"@reown/appkit-common": "1.8.14-embedded-mode-fix.0",
"@reown/appkit-controllers": "1.8.14-embedded-mode-fix.0",
"@reown/appkit-scaffold-ui": "1.8.14-embedded-mode-fix.0",
"@reown/appkit-ui": "1.8.14-embedded-mode-fix.0",
Comment on lines +38 to +45
Copy link
Collaborator

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?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep

"@sentry/core": "8.55.0",
"@sentry/nextjs": "8.55.0",
"@solana/web3.js": "1.98.4",
Expand All @@ -69,7 +69,7 @@
"@types/react": "19.1.15",
"@types/react-dom": "19.1.9",
"@mailsac/api": "1.0.8",
"@reown/appkit-testing": "1.8.8",
"@reown/appkit-testing": "1.8.14-embedded-mode-fix.0",
"@playwright/test": "1.48.2",
"eslint": "8.56.0",
"eslint-config-next": "14.1.0",
Expand Down
10 changes: 8 additions & 2 deletions packages/scaffold-ui/src/modal/w3m-modal/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
ApiController,
ChainController,
ConnectorController,
CoreHelperUtil,
ModalController,
ModalUtil,
OptionsController,
Expand Down Expand Up @@ -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
Copy link
Collaborator

@tomiir tomiir Nov 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

private async onNewAddress(newCaipAddress?: CaipAddress) {
  const oldAddress = CoreHelperUtil.getPlainAddress(this.caipAddress)
  const newAddress = CoreHelperUtil.getPlainAddress(newCaipAddress)

  const isSwitchingNamespace = ChainController.state.isSwitchingNamespace
  const isInProfileView = RouterController.state.view === 'ProfileWallets'

  const isDisconnectedAndIdle = !newAddress && !isSwitchingNamespace && !isInProfileView
  const isReconnect = this.enableEmbedded && !oldAddress && !!newAddress

  if (isDisconnectedAndIdle || isReconnect) {
    ModalController.close()
  }
}

can we apply something like this? think we should have more descriptive boolean names if we are introducing new conditions

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe isreconnect is not the proper one but I think you get my point
shouldClose tells me nothing about why it should close


Expand Down
Loading
Loading