mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Changed accounts fuzzy search threshhold to match all (#14914)
* Changed accounts fuzzy search threshhold to match all * Changed account search only when there is at least 2 terms * Fixed linting issue * Lint fix account menu component
This commit is contained in:
parent
25739a5fc1
commit
5a1bc94aa4
@ -100,11 +100,12 @@ export default class AccountMenu extends Component {
|
|||||||
};
|
};
|
||||||
|
|
||||||
addressFuse = new Fuse([], {
|
addressFuse = new Fuse([], {
|
||||||
threshold: 0.45,
|
threshold: 0.55,
|
||||||
location: 0,
|
location: 0,
|
||||||
distance: 100,
|
distance: 100,
|
||||||
maxPatternLength: 32,
|
maxPatternLength: 32,
|
||||||
minMatchCharLength: 1,
|
minMatchCharLength: 1,
|
||||||
|
ignoreFieldNorm: true,
|
||||||
keys: [
|
keys: [
|
||||||
{ name: 'name', weight: 0.5 },
|
{ name: 'name', weight: 0.5 },
|
||||||
{ name: 'address', weight: 0.5 },
|
{ name: 'address', weight: 0.5 },
|
||||||
@ -130,6 +131,11 @@ export default class AccountMenu extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
renderAccountsSearch() {
|
renderAccountsSearch() {
|
||||||
|
const handleChange = (e) => {
|
||||||
|
const val = e.target.value.length > 1 ? e.target.value : '';
|
||||||
|
this.setSearchQuery(val);
|
||||||
|
};
|
||||||
|
|
||||||
const inputAdornment = (
|
const inputAdornment = (
|
||||||
<InputAdornment
|
<InputAdornment
|
||||||
position="start"
|
position="start"
|
||||||
@ -149,8 +155,7 @@ export default class AccountMenu extends Component {
|
|||||||
id="search-accounts"
|
id="search-accounts"
|
||||||
placeholder={this.context.t('searchAccounts')}
|
placeholder={this.context.t('searchAccounts')}
|
||||||
type="text"
|
type="text"
|
||||||
value={this.state.searchQuery}
|
onChange={handleChange}
|
||||||
onChange={(e) => this.setSearchQuery(e.target.value)}
|
|
||||||
startAdornment={inputAdornment}
|
startAdornment={inputAdornment}
|
||||||
fullWidth
|
fullWidth
|
||||||
theme="material-white-padded"
|
theme="material-white-padded"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user