From 2b38acae17f5aebc1a8a2e0ae1a92829b338b190 Mon Sep 17 00:00:00 2001 From: zkldi <20380519+zkldi@users.noreply.github.com> Date: Sun, 16 Oct 2022 23:29:07 +0100 Subject: [PATCH] feat: redirect to rival manage if you have no rivals set --- .../_game/_playtype/rivals/RivalsMainPage.tsx | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/client/src/app/pages/dashboard/users/games/_game/_playtype/rivals/RivalsMainPage.tsx b/client/src/app/pages/dashboard/users/games/_game/_playtype/rivals/RivalsMainPage.tsx index 816d452cc..43fd7d9a3 100644 --- a/client/src/app/pages/dashboard/users/games/_game/_playtype/rivals/RivalsMainPage.tsx +++ b/client/src/app/pages/dashboard/users/games/_game/_playtype/rivals/RivalsMainPage.tsx @@ -2,10 +2,11 @@ import useSetSubheader from "components/layout/header/useSetSubheader"; import Divider from "components/util/Divider"; import Icon from "components/util/Icon"; import SelectLinkButton from "components/util/SelectLinkButton"; +import useLUGPTSettings from "components/util/useLUGPTSettings"; import useUGPTBase from "components/util/useUGPTBase"; import React from "react"; import { Col, Row } from "react-bootstrap"; -import { Route, Switch } from "react-router-dom"; +import { Redirect, Route, Switch } from "react-router-dom"; import { FormatGame, Game, GetGameConfig, Playtype, PublicUserDocument } from "tachi-common"; import RivalsComparePage from "./RivalsComparePage"; import RivalsManagePage from "./RivalsManagePage"; @@ -29,6 +30,12 @@ export default function RivalsMainPage({ const base = useUGPTBase({ reqUser, game, playtype }); + const { settings } = useLUGPTSettings(); + + if (!settings) { + return
You have no settings set. How did you cause this?
; + } + return ( @@ -59,7 +66,8 @@ export default function RivalsMainPage({ - activity + {settings?.rivals.length === 0 && } + NOT WRITTEN YET - folders + NOT IMPLEMENTED YET - goals milestones + NOT IMPLEMENTED YET