Skip to content

Commit

Permalink
fix: make steps selectable for staking actions
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-strzelec committed Feb 4, 2025
1 parent c3455ef commit 01019e0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ const FinalizeStep: FC<FinalizeStepProps> = ({
error: ActionTypes.RECLAIM_EXPENDITURE_STAKE_ERROR,
success: ActionTypes.RECLAIM_EXPENDITURE_STAKE_SUCCESS,
});
const associatedActionId = getMotionAssociatedActionId(actionData);

const handleSuccess = async () => {
startPollingAction(getSafePollingInterval());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,15 +166,8 @@ export const segregateCancelActions = (
export const getExpenditureStep = (
expenditure: Expenditure | null | undefined,
) => {
const {
status,
userStake,
cancellingActions,
lockingActions,
releaseActions,
isStaked,
} = expenditure || {};
const { isForfeited } = userStake || {};
const { status, cancellingActions, lockingActions, releaseActions } =
expenditure || {};
const isExpenditureFunded = isExpenditureFullyFunded(expenditure);

const allCancelledMotions = cancellingActions?.items
Expand Down Expand Up @@ -208,16 +201,11 @@ export const getExpenditureStep = (
if (isExpenditureFunded) {
return ExpenditureStep.Release;
}

return ExpenditureStep.Funding;
}
case ExpenditureStatus.Finalized:
return ExpenditureStep.Payment;
case ExpenditureStatus.Cancelled: {
if (isForfeited && isStaked) {
return ExpenditureStep.Reclaim;
}

if (releaseActions?.items && releaseActions?.items.length > 0) {
return `${ExpenditureStep.Cancel}-${3}`;
}
Expand Down

0 comments on commit 01019e0

Please sign in to comment.