Skip to content

Commit

Permalink
Merge branch 'igor/update-balance-after-redeem' into 'main'
Browse files Browse the repository at this point in the history
fix(dapp): update balances after redeeming action

See merge request pantherprotocol/panther-core!864
  • Loading branch information
pycckuu committed Jan 5, 2023
2 parents 13f3d48 + 07893f4 commit 72d15b2
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ import {
StartWalletActionPayload,
} from 'redux/slices/ui/web3-wallet-last-action';
import {updateUTXOStatus} from 'redux/slices/wallet/advanced-stakes-rewards';
import {getChainBalance} from 'redux/slices/wallet/chain-balance';
import {poolV0ExitDelaySelector} from 'redux/slices/wallet/poolV0';
import {getZkpTokenBalance} from 'redux/slices/wallet/zkp-token-balance';
import {parseTxErrorMessage} from 'services/errors';
import {generateRootKeypairs} from 'services/keys';
import {exit} from 'services/pool';
Expand Down Expand Up @@ -157,6 +159,8 @@ export default function SecondStageRedeem(props: {
reward.id,
UTXOStatus.SPENT,
]);
dispatch(getZkpTokenBalance, context);
dispatch(getChainBalance, context);

openNotification(
'Withdrawal completed successfully',
Expand All @@ -169,7 +173,7 @@ export default function SecondStageRedeem(props: {
'info',
10000,
);
}, [dispatch, library, account, chainId, reward]);
}, [dispatch, library, account, chainId, reward, context]);

useEffect(() => {
const timer = setInterval(() => {
Expand Down Expand Up @@ -267,8 +271,9 @@ export default function SecondStageRedeem(props: {
<PrimaryActionButton
onClick={closeModalAndRedeem}
disabled={!isLockPeriodPassed}
styles={`redeem-modal-button
${!isLockPeriodPassed && 'disabled'}`}
styles={`redeem-modal-button ${
!isLockPeriodPassed && 'disabled'
}`}
>
{isLockPeriodPassed ? (
<Typography>Redeem {zZKP} ZKP</Typography>
Expand Down

0 comments on commit 72d15b2

Please sign in to comment.