Skip to content

Commit

Permalink
feedback fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Baha committed Nov 23, 2021
1 parent 613336e commit 0201308
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
{{ $t('delegated_harvesting_keys_info') }}
</span>
<Alert
:visible="isVrfKeyLinked && isAccountKeyLinked && !isNodeKeyLinked"
:visible="isVrfKeyLinked && isAccountKeyLinked && !isNodeKeyLinked && !getNodeOperatorPublicKey()"
type="warning"
:value="$t('remote_keys_linked')"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down

0 comments on commit 0201308

Please sign in to comment.