Updated endGame method
This commit is contained in:
@@ -56,7 +56,7 @@ class GameManager extends ChangeNotifier {
|
||||
gameList.indexWhere((session) => session.id.toString() == id);
|
||||
|
||||
// Game session not found or not in unlimited mode
|
||||
if (index == -1 || gameList[index].isPointsLimitEnabled == false) return;
|
||||
if (index == -1 || gameList[index].isPointsLimitEnabled == true) return;
|
||||
|
||||
gameList[index].roundNumber--;
|
||||
gameList[index].isGameFinished = true;
|
||||
|
||||
@@ -227,8 +227,6 @@ class _ActiveGameViewState extends State<ActiveGameView> {
|
||||
),
|
||||
onPressed: () {
|
||||
setState(() {
|
||||
gameSession.isGameFinished = true;
|
||||
gameSession.roundNumber--;
|
||||
gameManager.endGame(gameSession.id);
|
||||
});
|
||||
Navigator.pop(context);
|
||||
|
||||
Reference in New Issue
Block a user