Skip to content

Commit

Permalink
Merge pull request #527 from AmbireTech/bug/sign-account-op-progress
Browse files Browse the repository at this point in the history
Bug / Sign Account Op status (in progress) glitches
  • Loading branch information
superKalo authored Jan 22, 2024
2 parents 51d727b + 637ad39 commit 062bdb2
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/controllers/signAccountOp/signAccountOp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -281,13 +281,23 @@ export class SignAccountOpController extends EventEmitter {
}

updateStatusToReadyToSign() {
const isInTheMiddleOfSigning =
this.status &&
[SigningStatus.InProgress, SigningStatus.InProgressAwaitingUserInput].includes(
this.status?.type
)

if (
this.isInitialized &&
this.#estimation &&
this.accountOp?.signingKeyAddr &&
this.accountOp?.signingKeyType &&
this.accountOp?.gasFeePayment &&
!this.errors.length
!this.errors.length &&
// Update if status is NOT already set (that's the initial state update)
// or in general if the user is not in the middle of signing (otherwise
// it resets the loading state back to ready to sign)
(!this.status || !isInTheMiddleOfSigning)
) {
this.status = { type: SigningStatus.ReadyToSign }
}
Expand Down

0 comments on commit 062bdb2

Please sign in to comment.