Skip to content

Commit

Permalink
Merge pull request #33 from Ninja-Official/fix/news_loading
Browse files Browse the repository at this point in the history
FIX: update news offset
  • Loading branch information
0niel authored Aug 23, 2021
2 parents c78ebb9 + 51e954a commit 12934a4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/presentation/bloc/news_bloc/news_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ class NewsBloc extends Bloc<NewsEvent, NewsState> {

final news = await getNews(GetNewsParams(offset: _offset, limit: 10));
yield news.fold((failure) => NewsLoadError(), (r) {
_offset += r.length - 1;
List<NewsItem> newNews = List.from(oldNews)..addAll(r);
_offset += r.length;
return NewsLoaded(news: newNews, tags: tagsList);
});
}
Expand Down

0 comments on commit 12934a4

Please sign in to comment.