Skip to content
This repository has been archived by the owner on Apr 15, 2019. It is now read-only.

Fix autocomplete when changing a vote - Closes #990 #1074

Merged
merged 1 commit into from
May 23, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/utils/api/delegate.js
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down