Skip to content

Commit 177a04f

Browse files
[thirdweb] fix: Initialize wallet connection status as unknown
1 parent aabdd7c commit 177a04f

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

.changeset/grumpy-vans-rhyme.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"thirdweb": patch
3+
---
4+
5+
Initialize activeWalletConnectionStatus as 'unknown' instead of 'disconnected'

packages/thirdweb/src/wallets/manager/index.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ import type { SmartWalletOptions } from "../smart/types.js";
1515
import type { WalletId } from "../wallet-types.js";
1616

1717
type WalletIdToConnectedWalletMap = Map<string, Wallet>;
18-
export type ConnectionStatus = "connected" | "disconnected" | "connecting";
18+
export type ConnectionStatus =
19+
| "connected"
20+
| "disconnected"
21+
| "connecting"
22+
| "unknown";
1923

2024
const CONNECTED_WALLET_IDS = "thirdweb:connected-wallet-ids";
2125
const LAST_ACTIVE_EOA_ID = "thirdweb:active-wallet-id";
@@ -47,7 +51,7 @@ export function createConnectionManager(storage: AsyncStorage) {
4751
const activeAccountStore = createStore<Account | undefined>(undefined);
4852
const activeWalletChainStore = createStore<Chain | undefined>(undefined);
4953
const activeWalletConnectionStatusStore =
50-
createStore<ConnectionStatus>("disconnected");
54+
createStore<ConnectionStatus>("unknown");
5155

5256
const definedChainsStore = createStore<Map<number, Chain>>(new Map());
5357

0 commit comments

Comments
 (0)