Skip to content

Commit

Permalink
Merge pull request #816 from ionicprotocol/feat/mode-velo-stake
Browse files Browse the repository at this point in the history
Fix rewards display
  • Loading branch information
rhlsthrm authored Dec 5, 2024
2 parents 085a2e6 + b2a3e0c commit b50b8db
Showing 1 changed file with 8 additions and 17 deletions.
25 changes: 8 additions & 17 deletions packages/ui/app/stake/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,24 +107,20 @@ export default function Stake() {
const isChainChange = previousChain.current !== currentChain;
previousChain.current = currentChain;

const availableTokens = tokenArrOfChain[+currentChain] || ['eth', 'weth'];
const currentToken = params.get('token');

if (
(!currentToken ||
(isChainChange && !availableTokens.includes(currentToken))) &&
currentChain
) {
if ((!currentToken && currentChain) || (isChainChange && currentChain)) {
const defaultToken = currentChain === String(mode.id) ? 'mode' : 'eth';
params.set('token', defaultToken);
shouldUpdate = true;

if (currentToken !== defaultToken) {
params.set('token', defaultToken);
shouldUpdate = true;
}
}

if (shouldUpdate) {
router.push(`?${params.toString()}`, { scroll: false });
}

// eslint-disable-next-line react-hooks/exhaustive-deps
}, [chainId, querychain, router, searchParams]);

const { address, isConnected } = useAccount();
Expand Down Expand Up @@ -794,14 +790,9 @@ export default function Stake() {
})}{' '}
ION/{selectedtoken.toUpperCase()}
</h1>
{/* tu */}
<h1 className="mt-1">
You will {step3Toggle === 'Unstake' && 'not'} get{' '}
{+chain === mode.id || +chain === optimism.id
? '$VELO'
: +chain === base.id
? '$AERO'
: ''}
You will {step3Toggle === 'Unstake' && 'not'} receive{' '}
{+chain === base.id ? 'AERO' : 'xVELO'}
</h1>

{/* breakdowns */}
Expand Down

0 comments on commit b50b8db

Please sign in to comment.