Skip to content

Commit bec3342

Browse files
fix: check for a connector when setting initial modal loader, added checks before resetting account
1 parent ddfad80 commit bec3342

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

.changeset/proud-badgers-provide.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
'@reown/appkit-wagmi-react-native': patch
3+
'@reown/appkit-auth-ethers-react-native': patch
4+
'@reown/appkit-auth-wagmi-react-native': patch
5+
'@reown/appkit-coinbase-ethers-react-native': patch
6+
'@reown/appkit-coinbase-wagmi-react-native': patch
7+
'@reown/appkit-common-react-native': patch
8+
'@reown/appkit-core-react-native': patch
9+
'@reown/appkit-ethers-react-native': patch
10+
'@reown/appkit-ethers5-react-native': patch
11+
'@reown/appkit-scaffold-react-native': patch
12+
'@reown/appkit-scaffold-utils-react-native': patch
13+
'@reown/appkit-siwe-react-native': patch
14+
'@reown/appkit-ui-react-native': patch
15+
'@reown/appkit-wallet-react-native': patch
16+
---
17+
18+
fix: changed condition for initial modal loading

packages/wagmi/src/client.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ export class AppKit extends AppKitScaffold {
431431
'address' | 'isConnected' | 'chainId' | 'connector' | 'isConnecting' | 'isReconnecting'
432432
>) {
433433
this.syncNetwork(address, chainId, isConnected);
434-
this.setLoading(isConnecting || isReconnecting);
434+
this.setLoading(!!connector && (isConnecting || isReconnecting));
435435

436436
if (isConnected && address && chainId) {
437437
const caipAddress: CaipAddress = `${ConstantsUtil.EIP155}:${chainId}:${address}`;
@@ -444,8 +444,7 @@ export class AppKit extends AppKitScaffold {
444444
this.getApprovedCaipNetworksData()
445445
]);
446446
this.hasSyncedConnectedAccount = true;
447-
} else if (!isConnected && this.hasSyncedConnectedAccount) {
448-
this.close();
447+
} else if (!isConnected && !isConnecting && !isReconnecting && this.hasSyncedConnectedAccount) {
449448
this.resetAccount();
450449
this.resetWcConnection();
451450
this.resetNetwork();
@@ -619,7 +618,8 @@ export class AppKit extends AppKitScaffold {
619618

620619
provider.onSetPreferredAccount(async () => {
621620
await reconnect(this.wagmiConfig, { connectors: [connector] });
622-
this.setLoading(false);
621+
// this.setLoading(false);
622+
// console.log('setLoading', false);
623623
});
624624

625625
provider.setOnTimeout(async () => {

0 commit comments

Comments
 (0)