InputAddress selects current value (via search) (#746)

This commit is contained in:
Jaco Greeff 2019-02-22 08:10:28 +01:00 committed by GitHub
parent 5ed108ef14
commit 4a1dacd239
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -37,7 +37,6 @@ type State = {
value?: string
};
const RECENT_KEY = 'header-recent';
const STORAGE_KEY = 'options:InputAddress';
const DEFAULT_TYPE = 'all';
@ -190,9 +189,10 @@ class InputAddress extends React.PureComponent<Props, State> {
const query = _query.trim();
const queryLower = query.toLowerCase();
const matches = filteredOptions.filter((item) =>
item.value === null ||
item.name.toLowerCase().indexOf(queryLower) !== -1 ||
item.value.toLowerCase().indexOf(queryLower) !== -1
item.value !== null && (
item.name.toLowerCase().indexOf(queryLower) !== -1 ||
item.value.toLowerCase().indexOf(queryLower) !== -1
)
);
const valueMatches = matches.filter((item) =>
@ -203,12 +203,6 @@ class InputAddress extends React.PureComponent<Props, State> {
const accountId = transformToAccountId(query);
if (accountId) {
if (!matches.find((item) => item.key === RECENT_KEY)) {
matches.push(
keyringOption.createOptionHeader('Recent')
);
}
matches.push(
keyring.saveRecent(
accountId