From 4a1dacd239818858d0fed0dfe91d6a23d5382c56 Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Fri, 22 Feb 2019 08:10:28 +0100 Subject: [PATCH] InputAddress selects current value (via search) (#746) --- packages/ui-app/src/InputAddress/index.tsx | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/packages/ui-app/src/InputAddress/index.tsx b/packages/ui-app/src/InputAddress/index.tsx index 2fcaa7997c..0eababdeca 100644 --- a/packages/ui-app/src/InputAddress/index.tsx +++ b/packages/ui-app/src/InputAddress/index.tsx @@ -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 { 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 { const accountId = transformToAccountId(query); if (accountId) { - if (!matches.find((item) => item.key === RECENT_KEY)) { - matches.push( - keyringOption.createOptionHeader('Recent') - ); - } - matches.push( keyring.saveRecent( accountId