use endReason to check if game has ended

This commit is contained in:
Nathaniel Tampus
2023-05-01 21:11:02 +08:00
parent da7f88e790
commit 970989579b

View File

@@ -148,7 +148,7 @@ export default function GamePage({ initialLobby }: { initialLobby: Game }) {
function updateTurnTitle() { function updateTurnTitle() {
if (lobby.side === "s" || !lobby.white?.id || !lobby.black?.id) return; if (lobby.side === "s" || !lobby.white?.id || !lobby.black?.id) return;
if (lobby.side === lobby.actualGame.turn() && !lobby.actualGame.isGameOver()) { if (!lobby.endReason && lobby.side === lobby.actualGame.turn()) {
document.title = "(your turn) chessu"; document.title = "(your turn) chessu";
} else { } else {
document.title = "chessu"; document.title = "chessu";