Skip to content

Commit 81f3f1f

Browse files
committed
fix token prompt + network switching
1 parent ad95764 commit 81f3f1f

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/features/common/components/platform-provider.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export function PlatformProvider({ children }: PropsWithChildren) {
3030
// The DataProvider key prop is super important it governs if the provider is reinitialized
3131
const dataProvider = shouldPromptForTokens ? (
3232
<DataProvider key={`${key}-tokenprompt`} networkConfig={networkConfig}>
33-
{children}
33+
<WalletProvider networkConfig={networkConfig}>{children}</WalletProvider>
3434
</DataProvider>
3535
) : (
3636
<DataProvider key={key} networkConfig={networkConfig}>

src/features/network/components/network-select.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ export function NetworkSelect({ showLabel = true }: NetworkSelectProps) {
1717
const location = useLocation()
1818

1919
const handleNetworkChange = useCallback(
20-
(newNetworkId: string) => {
20+
async (newNetworkId: string) => {
2121
const currentPath = location.pathname
22-
setSelectedNetwork(newNetworkId)
2322
if (currentNetworkId) {
2423
const newUrl = currentPath.replace(currentNetworkId, newNetworkId)
2524
navigate(newUrl)
2625
}
26+
await setSelectedNetwork(newNetworkId)
2727
},
2828
[currentNetworkId, location.pathname, navigate, setSelectedNetwork]
2929
)

src/features/network/data/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ export const useSetSelectedNetwork = () => {
330330

331331
return useCallback(
332332
async (selectedNetwork: string) => {
333-
disconnectAllWallets()
333+
await disconnectAllWallets()
334334
setStorageNetwork(selectedNetwork)
335335
// Refresh selected network atom value
336336
settingsStore.set(selectedNetworkAtomId)

0 commit comments

Comments
 (0)