From 178b241ac0bba77504b2c5c866187ce4596fa611 Mon Sep 17 00:00:00 2001 From: KRogLA Date: Wed, 15 Apr 2020 17:07:42 +0200 Subject: [PATCH] sub accounts search fix (#2572) * sub accounts search fix * bool type cast fix --- packages/page-staking/src/Overview/Address/index.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/page-staking/src/Overview/Address/index.tsx b/packages/page-staking/src/Overview/Address/index.tsx index ed05c9fd92..45591780a3 100644 --- a/packages/page-staking/src/Overview/Address/index.tsx +++ b/packages/page-staking/src/Overview/Address/index.tsx @@ -84,8 +84,9 @@ function checkVisibility (api: ApiPromise, address: string, filterName: string, if (accountId?.toString().includes(filterName) || accountIndex?.toString().includes(filterName)) { isVisible = true; - } else if (api.query.identity && api.query.identity.identityOf && identity?.display) { - isVisible = identity.display.toLowerCase().includes(filterLower); + } else if (api.query.identity && api.query.identity.identityOf) { + isVisible = (!!identity?.display && identity.display.toLowerCase().includes(filterLower)) || + (!!identity?.displayParent && identity.displayParent.toLowerCase().includes(filterLower)); } else if (nickname) { isVisible = nickname.toLowerCase().includes(filterLower); }