From fe117512154c62c836d407466d350112f2d302b6 Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Wed, 4 Dec 2019 17:15:31 +0100 Subject: [PATCH] Nominate update --- packages/app-staking/src/Actions/Account/Nominate.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/app-staking/src/Actions/Account/Nominate.tsx b/packages/app-staking/src/Actions/Account/Nominate.tsx index d5bd6b23db..4dd5f21c5b 100644 --- a/packages/app-staking/src/Actions/Account/Nominate.tsx +++ b/packages/app-staking/src/Actions/Account/Nominate.tsx @@ -37,11 +37,15 @@ function Nominate ({ className, controllerId, nominees, onClose, stashId, stashO useEffect((): void => { if (nominees) { + const _favorites = favorites.filter((accountId): boolean => + stashOptions.some(({ value }): boolean => value === accountId) + ); + const shortlist = [ // ensure that the favorite is included in the list of stashes - ...favorites.filter((accountId): boolean => stashOptions.some(({ value }): boolean => value === accountId)), + ..._favorites, // make sure the nominee is not in our favorites already - ...nominees.filter((accountId): boolean => !favorites.includes(accountId)) + ...nominees.filter((accountId): boolean => !_favorites.includes(accountId)) ]; setShortlist({