Skip to content

Commit 917ddd9

Browse files
authored
Merge pull request #12742 from Dharmik79/bug-website-language-wallet-change
added the useEffect to allow the reorder for the wallets based on locale
2 parents be5d928 + dbd8411 commit 917ddd9

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

src/hooks/useWalletTable.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useContext, useState } from "react"
1+
import { useContext, useEffect, useState } from "react"
22

33
import { DropdownOption } from "@/lib/types"
44

@@ -126,6 +126,14 @@ export const useWalletTable = ({
126126
})
127127
)
128128

129+
useEffect(() => {
130+
setWalletData(
131+
walletData.map((wallet) => {
132+
return { ...wallet, moreInfo: false, key: wallet.name }
133+
})
134+
)
135+
}, [walletData])
136+
129137
// Context API for language filter
130138
const { supportedLanguage } = useContext(WalletSupportedLanguageContext)
131139

src/pages/wallets/find-wallet.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,15 @@ const FindWalletPage = () => {
9595

9696
// If any wallet supports user's locale, show them (shuffled) at the top and then the remaining ones
9797
useEffect(() => {
98+
const supportedLocaleWallets = getSupportedLocaleWallets(locale!)
99+
100+
const noSupportedLocaleWallets = getNonSupportedLocaleWallets(locale!)
101+
98102
setRandomizedWalletData(
99103
supportedLocaleWallets.concat(noSupportedLocaleWallets)
100104
)
101105
// eslint-disable-next-line react-hooks/exhaustive-deps
102-
}, [])
106+
}, [locale])
103107

104108
const updateFilterOption = (key) => {
105109
const updatedFilters = { ...filters }

0 commit comments

Comments
 (0)