Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fixed an error checking if the game is active. #256

Merged
merged 1 commit into from
Apr 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions webapp/src/pages/Dashboard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ export default function Dashboard() {

useEffect(() => {
async function checkActiveStatus() {
const active = await isActive();
setActive(active);
const i = await isActive();
setActive(i.data.is_active);
}
checkActiveStatus();
}, []);
Expand Down Expand Up @@ -126,7 +126,7 @@ export default function Dashboard() {
</TabList>
<TabPanels>
<TabPanel>
{active && (
{!active && (
<Flex justify="center" flexWrap="wrap" flexDirection={{ base: "column", md: "row" }}>
{modes.map(mode => (
<Button
Expand Down Expand Up @@ -167,7 +167,7 @@ export default function Dashboard() {
</TabPanels>
</Tabs>
<Flex justify="center">
{active && (
{!active ? (
<Button
type="submit"
data-testid={"Play"}
Expand All @@ -182,8 +182,7 @@ export default function Dashboard() {
>
{t("common.play")}
</Button>
)}
{!active && (
) : (
<Button
type="submit"
data-testid={"Resume"}
Expand Down