x leaderboards don't show tables before data has loaded

This commit is contained in:
Kalle (Sendou)
2020-10-08 20:52:53 +03:00
parent cf59639e97
commit 1efe2a07cc
2 changed files with 4 additions and 0 deletions

View File

@@ -10,6 +10,7 @@ import MyThemeContext from "../../themeContext";
import { Weapon } from "../../types";
import { getPlacementString } from "../../utils/helperFunctions";
import Error from "../common/Error";
import Loading from "../common/Loading";
import Pagination from "../common/Pagination";
import {
Table,
@@ -46,6 +47,7 @@ export const PeakXPowerLeaderboard: React.FC<PeakXPowerLeaderboardProps> = ({
variables: { page: page + 1, weapon },
});
if (!data) return <Loading />;
if (error) return <Error errorMessage={error.message} />;
return (

View File

@@ -10,6 +10,7 @@ import {
import MyThemeContext from "../../themeContext";
import { getPlacementString } from "../../utils/helperFunctions";
import Error from "../common/Error";
import Loading from "../common/Loading";
import Pagination from "../common/Pagination";
import {
Table,
@@ -44,6 +45,7 @@ const XRankScoreLeaderboard: React.FC<PeakXPowerLeaderboardProps> = ({
variables: { page: page + 1, type },
});
if (!data) return <Loading />;
if (error) return <Error errorMessage={error.message} />;
return (