Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
JonBergland committed Jan 30, 2024
2 parents 9153836 + 9c17e0f commit 76f53a1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
36 changes: 18 additions & 18 deletions frontend/src/pages/connectFour/ConnectFour.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,25 +96,25 @@ function ConnectFour() {
}

const botMove = async () => {
console.log("Bot Move");
setErrorMessage(null);
setShallLoad(true);
console.log("Bot Move");
setErrorMessage(null);
setShallLoad(true);

let requestBody = {
gameId: gameData.gameId,
}
if (gameData.status === "Game in progress") {
const response = gameService.botMove(requestBody)
.then(result => {
// Update state with response data
setGameData(result);
console.log('Bot move result:', result);
})
.catch(error => {
setErrorMessage(error.message);
console.error('Error while making bot move:', error);
});
}
let requestBody = {
gameId: gameData.gameId,
}
if (gameData.status === "Game in progress") {
const response = gameService.botMove(requestBody)
.then(result => {
// Update state with response data
setGameData(result);
console.log('Bot move result:', result);
})
.catch(error => {
setErrorMessage(error.message);
console.error('Error while making bot move:', error);
});
}

setShallLoad(false);
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/mainmenu/MainMenu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function MainMenu() {
<img src="/images/BoardMaster.png" alt="BoardMaster Logo" width="20%"/>
<h2>Choose a game</h2>
<div className='games'>
<Link to={routes.chess}><button className='notImplemented'>Start New Chess game</button></Link>
<Link to={routes.chess}><button className='notImplemented' disabled="True">Start New Chess game</button></Link>
<Link to={routes.tic_tac_toe}><button className='Implemented'>Start New Tic Tac Toe game</button></Link>
<Link to={routes.connect_four}><button className='Implemented'>Start New Connect Four game</button></Link>
</div>
Expand Down

0 comments on commit 76f53a1

Please sign in to comment.