From ee99a990541063b6fcbdb047ff437dabacb6a85e Mon Sep 17 00:00:00 2001 From: Vit Stanislav Date: Fri, 18 May 2018 15:32:30 +0200 Subject: [PATCH] Fix autocomplete when changing a vote - Closes #990 --- src/utils/api/delegate.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/utils/api/delegate.js b/src/utils/api/delegate.js index e0c2f596f..d4d1b32ac 100644 --- a/src/utils/api/delegate.js +++ b/src/utils/api/delegate.js @@ -33,8 +33,9 @@ export const voteAutocomplete = (activePeer, username, votedDict) => { return new Promise((resolve, reject) => listDelegates(activePeer, options) .then((response) => { - resolve(response.data.filter(delegate => - Object.keys(votedDict).filter(item => item === delegate.username).length === 0, + resolve(response.delegates.filter(delegate => + Object.keys(votedDict).filter(item => + (item === delegate.username) && (item.confirmed || item.unconfirmed)).length === 0, )); }) .catch(reject),