Skip to content

Commit

Permalink
fix: error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
SidonieBouthors committed Sep 4, 2024
1 parent 26c2eb3 commit 29bed0e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app/src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ export default function Home({ username }: { username: string }) {
msg: turnStatus.move
? turnStatus.move.length == 1
? `Move from ${turnStatus.move[0].from} to ${turnStatus.move[0].to} is invalid`
: "Sequence of moves is invalid :" +
: "Sequence of moves is invalid : " +
turnStatus.move
.map((m) => `-> Move from ${m.from} to ${m.to}`)
.join("\n")
.map((m) => `\n-> Move from ${m.from} to ${m.to}`)
.join("")
: "No move provided",
msgType: ConsoleMessageType.Warning,
})
Expand Down Expand Up @@ -159,6 +159,7 @@ export default function Home({ username }: { username: string }) {
(turnStatus) => {
setConsoleOutput([]);
setGameOngoing(true);
setPlayer(player) // trigger re-render
updateGame(turnStatus);
},
(err) => alert(err.message)
Expand Down

0 comments on commit 29bed0e

Please sign in to comment.