From 1171fe6dfb7d88cf5e602cc31e3eb47c301621b9 Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Fri, 15 May 2020 20:41:34 +0200 Subject: [PATCH] Fix bonding errors --- .../src/Actions/Account/InputValidationController.tsx | 5 +++-- packages/page-staking/src/Actions/partials/Bond.tsx | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/page-staking/src/Actions/Account/InputValidationController.tsx b/packages/page-staking/src/Actions/Account/InputValidationController.tsx index 3bc8cef8dc..ae26474013 100644 --- a/packages/page-staking/src/Actions/Account/InputValidationController.tsx +++ b/packages/page-staking/src/Actions/Account/InputValidationController.tsx @@ -40,15 +40,16 @@ function ValidateController ({ accountId, controllerId, defaultController, onErr // this applies when changing controller if (defaultController !== controllerId) { let newError: string | null = null; - let isFatal = true; + let isFatal = false; if (bondedId) { + isFatal = true; newError = t('A controller account should not map to another stash. This selected controller is a stash, controlled by {{bondedId}}', { replace: { bondedId } }); } else if (stashId) { + isFatal = true; newError = t('A controller account should not be set to manages multiple stashes. The selected controller is already controlling {{stashId}}', { replace: { stashId } }); } else if (controllerId === accountId) { newError = t('Distinct stash and controller accounts are recommended to ensure fund security. You will be allowed to make the transaction, but take care to not tie up all funds, only use a portion of the available funds during this period.'); - isFatal = false; } onError(newError, isFatal); diff --git a/packages/page-staking/src/Actions/partials/Bond.tsx b/packages/page-staking/src/Actions/partials/Bond.tsx index 47055d2689..9d52dc5cd7 100644 --- a/packages/page-staking/src/Actions/partials/Bond.tsx +++ b/packages/page-staking/src/Actions/partials/Bond.tsx @@ -49,8 +49,10 @@ function Bond ({ className, onChange }: Props): React.ReactElement { stashId } : { + bondOwnTx: null, bondTx: null, controllerId: null, + controllerTx: null, stashId: null } );