Skip to content

Commit 271731d

Browse files
committed
Validator search now ignore spaces
1 parent 765106f commit 271731d

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/components/prestaking/PrestakingValidatorPage.vue

+6-4
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,12 @@ export default defineComponent({
114114
return 'label' in validator;
115115
}
116116
117-
return [
118-
('label' in validator ? validator.label : '').toLowerCase(),
119-
validator.address.toLowerCase(),
120-
].join('').includes(searchValue.value.toLowerCase());
117+
const searchTerm = searchValue.value.toLowerCase().replace(/\s+/g, '');
118+
const validatorLabel = ('label' in validator ? validator.label : '')
119+
.toLowerCase().replace(/\s+/g, '');
120+
const validatorAddress = validator.address.toLowerCase().replace(/\s+/g, '');
121+
122+
return validatorLabel.includes(searchTerm) || validatorAddress.includes(searchTerm);
121123
})
122124
.sort((a, b) => {
123125
const cmp = (a.stake ? a.stake : 0) - (b.stake ? b.stake : 0);

0 commit comments

Comments
 (0)