Fix loan display where there are no endpoints (#5581)

This commit is contained in:
Jaco 2021-06-14 08:02:31 +03:00 committed by GitHub
parent f3369f4ab9
commit ffb92d4958
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 4 deletions

View File

@ -61,9 +61,12 @@ export function expandEndpoint (t: TFunction, { dnslink, genesisHash, homepage,
const last = result[result.length - 1];
const options: LinkOption[] = [];
linked.sort(sortLinks).forEach((o) =>
options.push(...expandEndpoint(t, o, firstOnly))
);
linked
.sort(sortLinks)
.filter(({ paraId }) => paraId)
.forEach((o) =>
options.push(...expandEndpoint(t, o, firstOnly))
);
last.isRelay = true;
last.linked = options;

View File

@ -66,7 +66,7 @@ function Fund ({ bestHash, bestNumber, className, isOdd, isOngoing, leasePeriod,
const canContribute = isOngoing && !isCapped && !isWinner && !!blocksLeft;
const canDissolve = raised.isZero();
const canWithdraw = !raised.isZero() && hasEnded;
const homepage = endpoints.length && endpoints[0].homepage;
const homepage = endpoints.length !== 0 && endpoints[0].homepage;
useEffect((): void => {
setLastChange((prev): LastChange => {