Skip to content

Commit

Permalink
Mr changes
Browse files Browse the repository at this point in the history
  • Loading branch information
cp-mayank committed Dec 10, 2024
1 parent 39c1fc9 commit d8987f2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ class TournamentDetailStateViewNotifier
final teamStats = data.$2;
final keyStats = data.$3.getTopKeyStats();

_matchService.streamMatchesByIds(tournament.match_ids).listen((matches) {
_matchSubscription?.cancel();
_matchSubscription = _matchService
.streamMatchesByIds(tournament.match_ids)
.listen((matches) {
state = state.copyWith(
tournament: tournament,
teamStats: teamStats,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ class MatchSelectionViewNotifier extends StateNotifier<MatchSelectionState> {
void loadTournament() async {
if (_tournamentId == null) return;
_tournamentSubscription?.cancel();
_matchSubscription?.cancel();

state = state.copyWith(loading: true);

_tournamentSubscription = _tournamentService
.streamTournamentById(_tournamentId!)
.listen((tournament) async {
_matchSubscription?.cancel();
_matchSubscription = _matchService
.streamMatchesByIds(tournament.match_ids)
.listen((matches) {
Expand Down

0 comments on commit d8987f2

Please sign in to comment.