Browse Source

neon: Fix stackoverflows crashing the whole app

pull/152/head
jld3103 2 years ago
parent
commit
d1fd57038d
No known key found for this signature in database
GPG Key ID: 9062417B9E8EB7B3
  1. 4
      packages/neon/lib/src/apps/news/blocs/articles.dart
  2. 3
      packages/neon/lib/src/apps/news/blocs/news.dart

4
packages/neon/lib/src/apps/news/blocs/articles.dart

@ -59,7 +59,9 @@ class NewsArticlesBloc extends InteractiveBloc implements NewsArticlesBlocEvents
filterType.add(FilterType.all); filterType.add(FilterType.all);
} }
unawaited(refresh()); if (this is! NewsMainArticlesBloc) {
unawaited(refresh());
}
} }
final NewsBloc _newsBloc; final NewsBloc _newsBloc;

3
packages/neon/lib/src/apps/news/blocs/news.dart

@ -48,7 +48,7 @@ class NewsBloc extends InteractiveBloc implements NewsBlocEvents, NewsBlocStates
} }
}); });
unawaited(refresh()); unawaited(mainArticlesBloc.refresh());
} }
@override @override
@ -75,6 +75,7 @@ class NewsBloc extends InteractiveBloc implements NewsBlocEvents, NewsBlocStates
unawaited(unreadCounter.close()); unawaited(unreadCounter.close());
unawaited(articles.close()); unawaited(articles.close());
unawaited(filterType.close()); unawaited(filterType.close());
mainArticlesBloc.dispose();
super.dispose(); super.dispose();
} }

Loading…
Cancel
Save