From ab221d444db3e0b39598685ce2a9146663d74d6b Mon Sep 17 00:00:00 2001 From: Daithi Hearn Date: Sat, 8 Jul 2023 22:43:09 +0200 Subject: [PATCH] Allowing enable auto play when waiting --- src/components/Game/Actions/PlayCard.tsx | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/components/Game/Actions/PlayCard.tsx b/src/components/Game/Actions/PlayCard.tsx index d83a101..fb434d0 100644 --- a/src/components/Game/Actions/PlayCard.tsx +++ b/src/components/Game/Actions/PlayCard.tsx @@ -2,7 +2,6 @@ import { useCallback, useEffect, useMemo, useState } from "react" import GameService from "services/GameService" import { useAppDispatch, useAppSelector } from "caches/hooks" -import { useSnackbar } from "notistack" import { getMyCardsWithoutBlanks, getSelectedCards } from "caches/MyCardsSlice" import { getGameId, getIsMyGo, getRound } from "caches/GameSlice" import { BLANK_CARD } from "model/Cards" @@ -21,7 +20,6 @@ const WaitingForYourTurn = () => ( const PlayCard = () => { const dispatch = useAppDispatch() const round = useAppSelector(getRound) - const { enqueueSnackbar } = useSnackbar() const [autoPlay, setAutoPlay] = useState(false) const gameId = useAppSelector(getGameId) const myCards = useAppSelector(getMyCardsWithoutBlanks) @@ -82,7 +80,19 @@ const PlayCard = () => { Disable Auto Play ) - } else if (!playButtonEnabled) return + } else if (!playButtonEnabled) + return ( + <> + + + + ) return ( <>