Skip to content

Commit

Permalink
Merge pull request #2760 from JoinColony/fix/2739-tx-loading-order
Browse files Browse the repository at this point in the history
Fix pending order of `stakeMotion` transactions
  • Loading branch information
chmanie authored Jul 24, 2024
2 parents f4b4e6d + 732bc82 commit 72cd960
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 72cd960

Please sign in to comment.