From 56985e0ab27bdee3edc58ad52997e9d2e5b69c1f Mon Sep 17 00:00:00 2001 From: Kaloyan Kosev Date: Mon, 22 Jan 2024 14:03:22 +0200 Subject: [PATCH] Fixed: set default signing key only if there are any --- src/controllers/signAccountOp/signAccountOp.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/controllers/signAccountOp/signAccountOp.ts b/src/controllers/signAccountOp/signAccountOp.ts index 8f9b339f5..ea51ad05b 100644 --- a/src/controllers/signAccountOp/signAccountOp.ts +++ b/src/controllers/signAccountOp/signAccountOp.ts @@ -144,7 +144,10 @@ export class SignAccountOpController extends EventEmitter { // Otherwise, if we don't have a default value, then `this.readyToSign` will always be false unless we set a signer. // In that case, on the application, we want the "Sign" button to be clickable/enabled, // and we have to check and expose the `SignAccountOp` controller's inner state to make this check possible. - if (!this.accountOp.signingKeyAddr || !this.accountOp.signingKeyType) { + if ( + this.accountKeyStoreKeys.length && + (!this.accountOp.signingKeyAddr || !this.accountOp.signingKeyType) + ) { this.accountOp.signingKeyAddr = this.accountKeyStoreKeys[0].addr this.accountOp.signingKeyType = this.accountKeyStoreKeys[0].type }