Skip to content

Commit 16e8547

Browse files
committed
fix: new wallets cant see simulator
1 parent dafcad2 commit 16e8547

File tree

1 file changed

+3
-11
lines changed
  • web/src/pages/Courts/CourtDetails/StakePanel/SimulatorPopup

1 file changed

+3
-11
lines changed

web/src/pages/Courts/CourtDetails/StakePanel/SimulatorPopup/index.tsx

+3-11
Original file line numberDiff line numberDiff line change
@@ -124,17 +124,9 @@ const SimulatorPopup: React.FC<ISimulatorPopup> = ({ amountToStake, isStaking })
124124
const { id } = useParams();
125125
const { address } = useAccount();
126126
const { data: stakeData } = useJurorStakeDetailsQuery(address?.toLowerCase() as `0x${string}`);
127-
const courtStakeData = stakeData?.jurorTokensPerCourts?.find(({ court }) => court.id === id);
128-
const jurorCurrentEffectiveStake = address
129-
? !isUndefined(courtStakeData)
130-
? Number(formatEther(courtStakeData.effectiveStake))
131-
: undefined
132-
: 0;
133-
const jurorCurrentSpecificStake = address
134-
? !isUndefined(courtStakeData)
135-
? Number(formatEther(courtStakeData.staked))
136-
: undefined
137-
: 0;
127+
const jurorStakeData = stakeData?.jurorTokensPerCourts?.find(({ court }) => court.id === id);
128+
const jurorCurrentEffectiveStake = address && jurorStakeData ? Number(formatEther(jurorStakeData.effectiveStake)) : 0;
129+
const jurorCurrentSpecificStake = address && jurorStakeData ? Number(formatEther(jurorStakeData.staked)) : 0;
138130

139131
const timeframedCourtData = useHomePageExtraStats(30);
140132
const { prices: pricesData } = useCoinPrice([CoinIds.ETH]);

0 commit comments

Comments
 (0)