From 1efe2a07cc77a41802679bf1d4d5d7e3551bdbcf Mon Sep 17 00:00:00 2001 From: "Kalle (Sendou)" <38327916+Sendouc@users.noreply.github.com> Date: Thu, 8 Oct 2020 20:52:53 +0300 Subject: [PATCH] x leaderboards don't show tables before data has loaded --- .../src/components/xleaderboards/PeakXPowerLeaderboard.tsx | 2 ++ .../src/components/xleaderboards/XRankScoreLeaderboard.tsx | 2 ++ 2 files changed, 4 insertions(+) diff --git a/frontend-react/src/components/xleaderboards/PeakXPowerLeaderboard.tsx b/frontend-react/src/components/xleaderboards/PeakXPowerLeaderboard.tsx index a6afc498f..fa42f7c58 100644 --- a/frontend-react/src/components/xleaderboards/PeakXPowerLeaderboard.tsx +++ b/frontend-react/src/components/xleaderboards/PeakXPowerLeaderboard.tsx @@ -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 = ({ variables: { page: page + 1, weapon }, }); + if (!data) return ; if (error) return ; return ( diff --git a/frontend-react/src/components/xleaderboards/XRankScoreLeaderboard.tsx b/frontend-react/src/components/xleaderboards/XRankScoreLeaderboard.tsx index 71bb6f7ce..f6c9e1e5b 100644 --- a/frontend-react/src/components/xleaderboards/XRankScoreLeaderboard.tsx +++ b/frontend-react/src/components/xleaderboards/XRankScoreLeaderboard.tsx @@ -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 = ({ variables: { page: page + 1, type }, }); + if (!data) return ; if (error) return ; return (