Browse Source

fix(contacts-form): if there is an @ in the search we assume they are pasting pubkey@host format and ignore the host, searching only for the pubkey to the left of the @

renovate/lint-staged-8.x
Jack Mallers 7 years ago
parent
commit
a0838c87cd
  1. 6
      app/reducers/contactsform.js

6
app/reducers/contactsform.js

@ -70,7 +70,11 @@ const searchQuerySelector = state => state.contactsform.searchQuery
contactFormSelectors.filteredNetworkNodes = createSelector(
networkNodesSelector,
searchQuerySelector,
(nodes, searchQuery) => filter(nodes, node => node.alias.includes(searchQuery) || node.pub_key.includes(searchQuery))
(nodes, searchQuery) => {
const query = searchQuery.includes('@') ? searchQuery.split('@')[0] : searchQuery
return filter(nodes, node => node.alias.includes(query) || node.pub_key.includes(query))
}
)
contactFormSelectors.showManualForm = createSelector(

Loading…
Cancel
Save