sub accounts search fix (#2572)

* sub accounts search fix

* bool type cast fix
This commit is contained in:
KRogLA 2020-04-15 17:07:42 +02:00 committed by GitHub
parent 0140485bc1
commit 178b241ac0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);
}