Skip to content

Commit

Permalink
Merge pull request #1390 from LiskHQ/1352-search-no-results-for-long-…
Browse files Browse the repository at this point in the history
…address

Fix address search results when address is > 20 chars - Closes #1352
  • Loading branch information
Efefefef committed Oct 24, 2018
2 parents 5dc0969 + 9af002b commit 9c54916
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/utils/api/delegate.js
Expand Up @@ -7,7 +7,9 @@ export const listDelegates = (activePeer, options) => new Promise((resolve, reje
if (!activePeer) {
reject();
} else {
activePeer.delegates.get(options).then(response => resolve(response));
activePeer.delegates.get(options)
.then(response => resolve(response))
.catch(error => reject(error));
}
});

Expand Down
4 changes: 2 additions & 2 deletions src/utils/api/search.js
Expand Up @@ -20,7 +20,7 @@ const searchAddresses = ({ activePeer, searchTerm }) => new Promise((resolve, re
.then(response => resolve({ addresses: [response] }))
.catch(() => reject({ addresses: [] })));

const searchDelegates = ({ activePeer, searchTerm }) => new Promise((resolve, reject) =>
const searchDelegates = ({ activePeer, searchTerm }) => new Promise(resolve =>
listDelegates(activePeer, {
search: searchTerm,
sort: 'username:asc',
Expand All @@ -31,7 +31,7 @@ const searchDelegates = ({ activePeer, searchTerm }) => new Promise((resolve, re
}
resolve({ delegates: delegatesSorted });
})
.catch(() => reject({ delegates: [] })));
.catch(() => resolve({ delegates: [] })));

const searchTransactions = ({ activePeer, searchTerm }) => new Promise((resolve, reject) =>
getSingleTransaction({
Expand Down

0 comments on commit 9c54916

Please sign in to comment.