From c8beb839af38cced29a9cee22cd9fb87097acb01 Mon Sep 17 00:00:00 2001 From: Halit Aksoy Date: Sun, 4 Sep 2022 19:31:33 +0300 Subject: [PATCH] fix check connection --- src/routes/GamePage.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/routes/GamePage.tsx b/src/routes/GamePage.tsx index 331d841..83b7254 100644 --- a/src/routes/GamePage.tsx +++ b/src/routes/GamePage.tsx @@ -138,7 +138,7 @@ const GamePage: FunctionComponent<{ const checkHasAnOngoingAction = () => hasOngoingAction; const onLeaveGameClick = () => { - if(Util.checkConnectionAndMaybeAlert(context)) return; + if (Util.checkConnectionAndMaybeAlert(context)) return; swal({ title: context.texts.AreYouSureToLeaveGame, icon: "warning", @@ -153,7 +153,7 @@ const GamePage: FunctionComponent<{ }; const onNewGameClick = () => { - if(Util.checkConnectionAndMaybeAlert(context)) return; + if (Util.checkConnectionAndMaybeAlert(context)) return; navigate("/loby") }; @@ -161,6 +161,7 @@ const GamePage: FunctionComponent<{ if (!game || isSpectator || !userKey) { return; } + if (Util.checkConnectionAndMaybeAlert(context)) return; if (game.mancalaGame.getPlayerIdByIndex(index) !== userKey) { notyf.error(context.texts.UCanOnlyPlayYourOwnPits); return; @@ -174,7 +175,6 @@ const GamePage: FunctionComponent<{ notyf.error(context.texts.UMustWaitUntilCurrentMoveComplete); return; } - if(Util.checkConnectionAndMaybeAlert(context)) return; if (!boardViewModel) return; //TODO: this check should be in mancala.js if (pit.stoneCount === 0) {