Skip to content

Commit

Permalink
fix token prompt + network switching
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrickDinh committed Jan 29, 2025
1 parent ad95764 commit 81f3f1f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/features/common/components/platform-provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export function PlatformProvider({ children }: PropsWithChildren) {
// The DataProvider key prop is super important it governs if the provider is reinitialized
const dataProvider = shouldPromptForTokens ? (
<DataProvider key={`${key}-tokenprompt`} networkConfig={networkConfig}>
{children}
<WalletProvider networkConfig={networkConfig}>{children}</WalletProvider>
</DataProvider>
) : (
<DataProvider key={key} networkConfig={networkConfig}>
Expand Down
4 changes: 2 additions & 2 deletions src/features/network/components/network-select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ export function NetworkSelect({ showLabel = true }: NetworkSelectProps) {
const location = useLocation()

const handleNetworkChange = useCallback(
(newNetworkId: string) => {
async (newNetworkId: string) => {
const currentPath = location.pathname
setSelectedNetwork(newNetworkId)
if (currentNetworkId) {
const newUrl = currentPath.replace(currentNetworkId, newNetworkId)
navigate(newUrl)
}
await setSelectedNetwork(newNetworkId)
},
[currentNetworkId, location.pathname, navigate, setSelectedNetwork]
)
Expand Down
2 changes: 1 addition & 1 deletion src/features/network/data/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ export const useSetSelectedNetwork = () => {

return useCallback(
async (selectedNetwork: string) => {
disconnectAllWallets()
await disconnectAllWallets()
setStorageNetwork(selectedNetwork)
// Refresh selected network atom value
settingsStore.set(selectedNetworkAtomId)
Expand Down

0 comments on commit 81f3f1f

Please sign in to comment.