Skip to content

Commit

Permalink
Merge pull request #256 from Arquisoft/fix/webapp/resume-game
Browse files Browse the repository at this point in the history
fix: fixed an error checking if the game is active.
  • Loading branch information
jjgancfer authored Apr 20, 2024
2 parents 9512131 + cd0fa27 commit 6313d61
Showing 1 changed file with 5 additions and 6 deletions.
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

0 comments on commit 6313d61

Please sign in to comment.