Skip to content

Commit 4a525bc

Browse files
authored
fix: status for default network on usePolkadotClient (#278)
1 parent 9fb7ee6 commit 4a525bc

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

examples/demo-multi-clients/src/App.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import { usePolkadotClient, useTypink } from 'typink';
88

99
function App() {
1010
const { networks } = useTypink();
11-
const [relay, assethub, people] = networks;
12-
const { status: relayStatus } = usePolkadotClient(relay?.id);
11+
const [assethub, people] = networks;
12+
const { status: relayStatus } = usePolkadotClient();
1313
const { status: assetHubStatus } = usePolkadotClient(assethub?.id);
1414
const { status: peopleStatus } = usePolkadotClient(people?.id);
1515

packages/typink/src/hooks/usePolkadotClient.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ export function usePolkadotClient<ChainApi extends VersionedGenericSubstrateApi
3434
}, [getClient, networkId]);
3535

3636
const status = useMemo(() => {
37-
return connectionStatus.get(networkId || '') || ClientConnectionStatus.NotConnected;
38-
}, [connectionStatus, networkId]);
37+
return connectionStatus.get(network.id || '') || ClientConnectionStatus.NotConnected;
38+
}, [connectionStatus, network]);
3939

4040
return { client, network, status };
4141
}

0 commit comments

Comments
 (0)