Save finished games and add history views

This commit is contained in:
2026-03-03 19:05:54 +01:00
parent 7887986a5a
commit d1b432f8aa
11 changed files with 919 additions and 33 deletions
+12 -5
View File
@@ -464,11 +464,18 @@ export class PlayApp {
onGameOver(data) {
this.setStatus(`Game over: ${data.result} (${data.reason})`);
this.showModal(
"Game over",
`${data.result.toUpperCase()} - ${data.reason}`,
[{ label: "OK" }],
);
const actions = [{ label: "OK" }];
if (data.game_id) {
actions.unshift({
label: "View saved game",
className: "btn-primary",
onClick: () => {
window.location.href = `/games/${data.game_id}`;
},
});
}
this.showModal("Game over", `${data.result.toUpperCase()} - ${data.reason}`, actions);
}
onDrawOffered(data) {