From 674aad81fe7738987c285dfaf94cfa3399cf9d88 Mon Sep 17 00:00:00 2001 From: Adrian Wannenmacher Date: Wed, 18 Feb 2026 19:00:40 +0100 Subject: [PATCH] add event listener to game on session destructuring --- models/session.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/models/session.js b/models/session.js index b943ca6..fe681cb 100644 --- a/models/session.js +++ b/models/session.js @@ -235,6 +235,8 @@ export default class Session extends EventTarget { throw new TypeError("struct must contain currentGame as object"); if (value.currentGame !== null) { this.#currentGame = new Game(value.currentGame); + this.#currentGame.addEventListener( + Game.EVENT_CHANGE, this.#boundHandleGameChange); if (this.#currentGame.result.winner !== null) throw new Error("currentGame in struct must not be finished"); }