Skip to content

Commit

Permalink
Update deposit status to error after 1 hour if the deposit is in INB_…
Browse files Browse the repository at this point in the history
…TRANSFER
  • Loading branch information
ThibaultJRD committed Feb 1, 2024
1 parent c058671 commit 454d673
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/pages/MySavings/components/DepositTable/DepositTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,16 @@ const DepositTable = ({ deposits, pools, prices, onLeavePool, onDepositRetry, on
break;

case DepositState.DEPOSIT_STATE_IBC_TRANSFER:
// If the deposit is older than 1 hour, we consider it as failed
if (deposit.updatedAt && dayjs().diff(dayjs(deposit.updatedAt), 'hours') > 1) {
statusClassName = 'failure';
cta = <Button onClick={() => onDepositRetry(deposit as DepositModel)}>{I18n.t('common.retry')}</Button>;
} else {
statusClassName = 'pending';
cta = I18n.t('mySavings.transferWaitingCta');
}
break;

case DepositState.DEPOSIT_STATE_ICA_DELEGATE:
statusClassName = 'pending';
cta = I18n.t('mySavings.transferWaitingCta');
Expand Down

0 comments on commit 454d673

Please sign in to comment.