Skip to content

Commit

Permalink
fix: not show stats after disabled wallet (unsupported chain way)
Browse files Browse the repository at this point in the history
  • Loading branch information
solidovic committed Aug 21, 2024
1 parent 247de1e commit f16e144
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions features/rewards/hooks/useGetCurrentAddress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { useSDK } from '@lido-sdk/react';

import { resolveEns, isValidEns, isValidAddress } from 'features/rewards/utils';
import { useCurrentStaticRpcProvider } from 'shared/hooks/use-current-static-rpc-provider';
import { useDappStatus } from 'shared/hooks/use-dapp-status';
import { overrideWithQAMockString } from 'utils/qa';

type UseGetCurrentAddress = () => {
Expand All @@ -28,6 +29,7 @@ export const useGetCurrentAddress: UseGetCurrentAddress = () => {
const { account } = useSDK();
const { staticRpcProvider } = useCurrentStaticRpcProvider();
const { isReady, query } = useRouter();
const { isSupportedChain } = useDappStatus();

const getEnsAddress = useCallback(
async (value: string) => {
Expand Down Expand Up @@ -87,13 +89,13 @@ export const useGetCurrentAddress: UseGetCurrentAddress = () => {
return;
}
// From a connected wallet
if (account) {
if (account && isSupportedChain) {
setInputValue(
overrideWithQAMockString(account, 'mock-qa-rewards-address'),
);
}
}
}, [account, query.address, isReady, setInputValue]);
}, [account, query.address, isReady, setInputValue, isSupportedChain]);

return {
address,
Expand Down

0 comments on commit f16e144

Please sign in to comment.