Skip to content

Commit 35999c7

Browse files
fix: close wagmi modal on disconnect
1 parent bec3342 commit 35999c7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/wagmi/src/client.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,8 +377,12 @@ export class AppKit extends AppKitScaffold {
377377
});
378378

379379
watchAccount(wagmiConfig, {
380-
onChange: accountData => {
380+
onChange: (accountData, prevAccountData) => {
381381
this.syncAccount({ ...accountData });
382+
383+
if (accountData.status === 'disconnected' && prevAccountData.status === 'connected') {
384+
this.close();
385+
}
382386
}
383387
});
384388
}

0 commit comments

Comments
 (0)