Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix broadcast game screen blinking when a new move is received #1313

Merged
merged 8 commits into from
Jan 12, 2025
26 changes: 13 additions & 13 deletions lib/src/view/broadcast/broadcast_game_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -112,19 +112,19 @@ class _BroadcastGameScreenState extends ConsumerState<BroadcastGameScreen>
),
],
),
body: switch ((broadcastRoundGameState, broadcastGameState)) {
(AsyncData(), AsyncData()) => _Body(
widget.tournamentId,
widget.roundId,
widget.gameId,
widget.tournamentSlug,
widget.roundSlug,
tabController: _tabController,
),
(AsyncError(:final error), _) => Center(child: Text('Cannot load broadcast game: $error')),
(_, AsyncError(:final error)) => Center(child: Text('Cannot load broadcast game: $error')),
_ => const Center(child: CircularProgressIndicator.adaptive()),
},
body:
(broadcastRoundGameState.hasValue && broadcastGameState.hasValue)
? _Body(
widget.tournamentId,
widget.roundId,
widget.gameId,
widget.tournamentSlug,
widget.roundSlug,
tabController: _tabController,
)
: (broadcastGameState.hasError || broadcastRoundGameState.hasError)
? const Center(child: Text('Cannot load broadcast game'))
: const Center(child: CircularProgressIndicator.adaptive()),
);
}
}
Expand Down
Loading