Fix: Games and Game page save and navigation.

This commit is contained in:
2026-02-10 19:21:22 +00:00
parent 81fdfffbe5
commit 29ddd1ded0
7 changed files with 86 additions and 95 deletions

View File

@@ -438,7 +438,7 @@ export default class PageMtgGame extends TableBasePage {
const latestRoundId = PageMtgGame.getLatestRoundId();
const damageIndex = damageRecords.findIndex(damageRecord => (
damage[attrRoundId] == latestRoundId
damageRecord[attrRoundId] == latestRoundId
&& damageRecord[attrPlayerId] == playerId
&& damageRecord[attrReceivedFromCommanderPlayerId] == sourceId
));
@@ -616,18 +616,18 @@ export default class PageMtgGame extends TableBasePage {
}
async saveGame() {
/*
const gameState = {
[flagPlayer]: players
, [flagRound]: rounds
, [flagDamage]: damageRecords
};
/*
if (gameState[flagPlayer].length > 0) {
localStorage.setItem(`mtgGame_${gameId}`, JSON.stringify(gameState));
PageMtgGame.showSaveIndicator();
}
*/
const comment = 'Save players';
const comment = 'Save player damage';
const self = this;
API.saveGameRoundPlayerDamages(rounds, damageRecords, null, comment)
.then(data => {