fix: util function names for filter

This commit is contained in:
RadoslavDimchev 2023-11-15 21:51:54 +02:00
parent 66093a8f9c
commit 5fb05ad24d
1 changed files with 4 additions and 4 deletions

View File

@ -63,14 +63,14 @@ type ManagementTableProps = {
tab: string tab: string
} }
const testValidatorStatus = (validatorStatus: string, tabStatus: string) => { const isValidStatus = (validatorStatus: string, tabStatus: string) => {
if (validatorStatus === tabStatus || tabStatus === VALIDATOR_TABS[VALIDATOR_TABS.length - 1]) { if (validatorStatus === tabStatus || tabStatus === VALIDATOR_TABS[VALIDATOR_TABS.length - 1]) {
return true return true
} }
return false return false
} }
const testNumberAndAddress = ( const isValidNumberOrAddress = (
validatorNumber: number, validatorNumber: number,
validatorAddress: string, validatorAddress: string,
searchValue: string, searchValue: string,
@ -86,8 +86,8 @@ const ManagementTable = ({ tab }: ManagementTableProps) => {
const filteredValidators = useMemo(() => { const filteredValidators = useMemo(() => {
return validators return validators
.filter(validator => testValidatorStatus(validator.status, tab)) .filter(validator => isValidStatus(validator.status, tab))
.filter(validator => testNumberAndAddress(validator.number, validator.address, searchValue)) .filter(validator => isValidNumberOrAddress(validator.number, validator.address, searchValue))
}, [tab, searchValue]) }, [tab, searchValue])
const changeSearchValue = (value: string) => { const changeSearchValue = (value: string) => {