From 020130896706e5ab16169a63768fe3a82ffce62e Mon Sep 17 00:00:00 2001 From: Baha Date: Tue, 23 Nov 2021 07:55:22 +0000 Subject: [PATCH] feedback fixes --- ...PersistentDelegationRequestTransaction.vue | 2 +- ...ersistentDelegationRequestTransactionTs.ts | 19 ++++++++++--------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/views/forms/FormPersistentDelegationRequestTransaction/FormPersistentDelegationRequestTransaction.vue b/src/views/forms/FormPersistentDelegationRequestTransaction/FormPersistentDelegationRequestTransaction.vue index 65d9818a6..8590bb6b4 100644 --- a/src/views/forms/FormPersistentDelegationRequestTransaction/FormPersistentDelegationRequestTransaction.vue +++ b/src/views/forms/FormPersistentDelegationRequestTransaction/FormPersistentDelegationRequestTransaction.vue @@ -110,7 +110,7 @@ {{ $t('delegated_harvesting_keys_info') }} diff --git a/src/views/forms/FormPersistentDelegationRequestTransaction/FormPersistentDelegationRequestTransactionTs.ts b/src/views/forms/FormPersistentDelegationRequestTransaction/FormPersistentDelegationRequestTransactionTs.ts index 47394dbbf..3e214136e 100644 --- a/src/views/forms/FormPersistentDelegationRequestTransaction/FormPersistentDelegationRequestTransactionTs.ts +++ b/src/views/forms/FormPersistentDelegationRequestTransaction/FormPersistentDelegationRequestTransactionTs.ts @@ -254,18 +254,19 @@ export class FormPersistentDelegationRequestTransactionTs extends FormTransactio this.formItems.nodeModel = { nodePublicKey: this.currentSignerAccountInfo?.supplementalPublicKeys.node.publicKey } as NodeModel; } else { // Check account is belong to node operator. - const nodeInfo = await new NodeService().getNodeFromStatisticServiceByPublicKey( - this.networkType, - this.currentSignerAccountInfo.publicKey, - ); - if (nodeInfo) { - this.formItems.nodeModel = { nodePublicKey: nodeInfo.nodePublicKey } as NodeModel; - } else { - this.formItems.nodeModel = { nodePublicKey: '' } as NodeModel; - } + const nodeOperatorPublicKey = await this.getNodeOperatorPublicKey(); + this.formItems.nodeModel = { nodePublicKey: nodeOperatorPublicKey ? nodeOperatorPublicKey : '' } as NodeModel; } } + public async getNodeOperatorPublicKey() { + const nodeInfo = await new NodeService().getNodeFromStatisticServiceByPublicKey( + this.networkType, + this.currentSignerAccountInfo.publicKey, + ); + return nodeInfo?.nodePublicKey; + } + @Watch('formItems.nodeModel', { immediate: true }) private nodeModelChanged() { if (