Fixed incoming changes

This commit is contained in:
2026-05-05 11:43:35 +02:00
parent 9896008335
commit eadf05e116
2 changed files with 5 additions and 18 deletions

View File

@@ -469,38 +469,32 @@ class _CreateGameViewState extends State<CreateGameView> {
final oldGame = widget.gameToEdit!;
if (oldGame.name != newGame.name) {
await db.gameDao.updateGameName(
gameId: oldGame.id,
newName: newGame.name,
);
await db.gameDao.updateGameName(gameId: oldGame.id, name: newGame.name);
}
if (oldGame.description != newGame.description) {
await db.gameDao.updateGameDescription(
gameId: oldGame.id,
newDescription: newGame.description,
description: newGame.description,
);
}
if (oldGame.ruleset != newGame.ruleset) {
await db.gameDao.updateGameRuleset(
gameId: oldGame.id,
newRuleset: newGame.ruleset,
ruleset: newGame.ruleset,
);
}
if (oldGame.color != newGame.color) {
await db.gameDao.updateGameColor(
gameId: oldGame.id,
newColor: newGame.color,
color: newGame.color,
);
}
if (oldGame.icon != newGame.icon) {
await db.gameDao.updateGameIcon(
gameId: oldGame.id,
newIcon: newGame.icon,
);
await db.gameDao.updateGameIcon(gameId: oldGame.id, icon: newGame.icon);
}
}

View File

@@ -295,13 +295,6 @@ class _CreateMatchViewState extends State<CreateMatchView> {
);
}
if (widget.matchToEdit!.game.id != updatedMatch.game.id) {
await db.matchDao.updateMatchGame(
matchId: widget.matchToEdit!.id,
gameId: updatedMatch.game.id,
);
}
// Add players who are in updatedMatch but not in the original match
for (var player in updatedMatch.players) {
if (!widget.matchToEdit!.players.any((p) => p.id == player.id)) {