Skip to content

Commit

Permalink
fix: pending order of stakeMotion transactions
Browse files Browse the repository at this point in the history
  • Loading branch information
chmanie committed Jul 23, 2024
1 parent 300f4b9 commit 732bc82
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions src/redux/sagas/motions/stakeMotion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,20 @@ function* stakeMotion({
yield takeFrom(annotateStaking.channel, ActionTypes.TRANSACTION_CREATED);
}

if (activateTokens) {
yield put(transactionPending(approve.id));

yield initiateTransaction({ id: approve.id });

yield waitForTxResult(approve.channel);

yield put(transactionPending(deposit.id));

yield initiateTransaction({ id: deposit.id });

yield waitForTxResult(deposit.channel);
}

yield put(transactionPending(approveStake.id));

const { domainId, rootHash } = yield call(
Expand All @@ -185,16 +199,6 @@ function* stakeMotion({
]),
);

if (activateTokens) {
yield initiateTransaction({ id: approve.id });

yield waitForTxResult(approve.channel);

yield initiateTransaction({ id: deposit.id });

yield waitForTxResult(deposit.channel);
}

yield initiateTransaction({ id: approveStake.id });

yield waitForTxResult(approveStake.channel);
Expand Down

0 comments on commit 732bc82

Please sign in to comment.