Skip to content

Commit 7def4a5

Browse files
committed
clear dialog account on init
1 parent 79c080e commit 7def4a5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

apps/dialog/src/main.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ if (import.meta.env.PROD) {
3535
const offInitialized = Events.onInitialized(porto, async (payload, event) => {
3636
const { chainIds, features, labels, mode, referrer, theme } = payload
3737

38+
// Clear accounts on dialog init. If the parent has a connected account,
39+
// it will be synced via when the first request comes in (requireAccountSync).
40+
porto._internal.store.setState((x) => ({ ...x, accounts: [] }))
41+
3842
// Prevent showing stale route from a previous action.
3943
const pathname = Router.router.state.location.pathname.replace(/\/+$/, '')
4044
if (pathname !== '/dialog') await Router.router.navigate({ to: '/dialog' })

0 commit comments

Comments
 (0)