Skip to content

Commit

Permalink
chore: fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
khanti42 committed Jan 28, 2025
1 parent 50f73b3 commit a04348e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion packages/wallet-ui/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ import { DeployModal } from 'components/ui/organism/DeployModal';
library.add(fas, far);

function App() {
const { initSnap, getWalletData, checkConnection } = useStarkNetSnap();
const { initSnap, getWalletData, checkConnection, loadLocale } =
useStarkNetSnap();
const { connected, forceReconnect, provider } = useAppSelector(
(state) => state.wallet,
);
Expand Down Expand Up @@ -64,6 +65,12 @@ function App() {
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [networks.activeNetwork, provider]);

useEffect(() => {
if (connected) {
loadLocale();
}
}, [connected, loadLocale]);

const loading = loader.isLoading;
return (
<ThemeProvider theme={theme}>
Expand Down
2 changes: 1 addition & 1 deletion packages/wallet-ui/src/services/useStarkNetSnap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,6 @@ export const useStarkNetSnap = () => {
dispatch(setActiveNetwork(idx));
const chainId = net.chainId;
await getWalletData(chainId, nets);
await loadLocale();
} catch (err: any) {
if (err.code && err.code === 4100) {
const toastr = new Toastr();
Expand Down Expand Up @@ -1002,6 +1001,7 @@ export const useStarkNetSnap = () => {

return {
connectToSnap,
loadLocale,
getNetworks,
getAccounts,
addAccount,
Expand Down

0 comments on commit a04348e

Please sign in to comment.