diff --git a/lib/pangea/pages/games/story_game/round_model.dart b/lib/pangea/pages/games/story_game/round_model.dart index 7c2f16873..61beb6242 100644 --- a/lib/pangea/pages/games/story_game/round_model.dart +++ b/lib/pangea/pages/games/story_game/round_model.dart @@ -27,6 +27,7 @@ class GameRoundModel { required this.timer, }) { createdAt = DateTime.now(); + debugPrint("timeline: ${controller.room.timeline}"); syncSubscription ??= client.onSync.stream.listen((update) { final newMessages = update.messages(controller.room); final botMessages = newMessages @@ -43,6 +44,7 @@ class GameRoundModel { startRound(); } else if (state == RoundState.inProgress) { endRound(); + return; } } diff --git a/lib/pangea/widgets/chat/round_timer.dart b/lib/pangea/widgets/chat/round_timer.dart index 2ea43761f..83641983d 100644 --- a/lib/pangea/widgets/chat/round_timer.dart +++ b/lib/pangea/widgets/chat/round_timer.dart @@ -74,6 +74,14 @@ class RoundTimerState extends State { super.initState(); } + @override + void dispose() { + if (_timer != null) { + _timer!.cancel(); + } + super.dispose(); + } + @override Widget build(BuildContext context) { return Material(