From d1fd57038d78472a991bb42f4f1ac403b1bbc629 Mon Sep 17 00:00:00 2001 From: jld3103 Date: Sat, 10 Dec 2022 14:27:12 +0100 Subject: [PATCH] neon: Fix stackoverflows crashing the whole app --- packages/neon/lib/src/apps/news/blocs/articles.dart | 4 +++- packages/neon/lib/src/apps/news/blocs/news.dart | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/neon/lib/src/apps/news/blocs/articles.dart b/packages/neon/lib/src/apps/news/blocs/articles.dart index b6f0c404..a487bd6f 100644 --- a/packages/neon/lib/src/apps/news/blocs/articles.dart +++ b/packages/neon/lib/src/apps/news/blocs/articles.dart @@ -59,7 +59,9 @@ class NewsArticlesBloc extends InteractiveBloc implements NewsArticlesBlocEvents filterType.add(FilterType.all); } - unawaited(refresh()); + if (this is! NewsMainArticlesBloc) { + unawaited(refresh()); + } } final NewsBloc _newsBloc; diff --git a/packages/neon/lib/src/apps/news/blocs/news.dart b/packages/neon/lib/src/apps/news/blocs/news.dart index f396b116..130ee71d 100644 --- a/packages/neon/lib/src/apps/news/blocs/news.dart +++ b/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 @@ -75,6 +75,7 @@ class NewsBloc extends InteractiveBloc implements NewsBlocEvents, NewsBlocStates unawaited(unreadCounter.close()); unawaited(articles.close()); unawaited(filterType.close()); + mainArticlesBloc.dispose(); super.dispose(); }