hotfix: account for custom endpoint possible conditions in stakehistory (#16151)

This commit is contained in:
Josh 2021-03-26 10:54:53 -07:00 committed by GitHub
parent d2e4503be2
commit a1f1f573d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -98,7 +98,11 @@ function StakingComponent() {
return <LoadingCard />;
} else if (typeof supply === "string") {
return <ErrorCard text={supply} retry={fetchData} />;
} else if (stakeInfo.status === FetchStatus.FetchFailed) {
} else if (
stakeInfo.status === FetchStatus.FetchFailed ||
(stakeInfo.status === FetchStatus.Fetched &&
(!stakeHistory.length || stakeHistory.length < 1))
) {
return (
<ErrorCard text={"Failed to fetch active stake"} retry={fetchData} />
);