Skip to content

Commit baf98a1

Browse files
committed
feat(content_management): add force refresh to repository update subscriptions
- Add `forceRefresh: true` parameter to `LoadHeadlinesRequested`, `LoadTopicsRequested`, and `LoadSourcesRequested` events - This ensures that the content management bloc refreshes its data when updates are detected in the repositories
1 parent f50d62c commit baf98a1

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

lib/content_management/bloc/content_management_bloc.dart

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,19 +42,28 @@ class ContentManagementBloc
4242
_headlineUpdateSubscription = _headlinesRepository.entityUpdated
4343
.where((type) => type == Headline)
4444
.listen((_) {
45-
add(const LoadHeadlinesRequested(limit: kDefaultRowsPerPage));
45+
add(const LoadHeadlinesRequested(
46+
limit: kDefaultRowsPerPage,
47+
forceRefresh: true,
48+
));
4649
});
4750

4851
_topicUpdateSubscription = _topicsRepository.entityUpdated
4952
.where((type) => type == Topic)
5053
.listen((_) {
51-
add(const LoadTopicsRequested(limit: kDefaultRowsPerPage));
54+
add(const LoadTopicsRequested(
55+
limit: kDefaultRowsPerPage,
56+
forceRefresh: true,
57+
));
5258
});
5359

5460
_sourceUpdateSubscription = _sourcesRepository.entityUpdated
5561
.where((type) => type == Source)
5662
.listen((_) {
57-
add(const LoadSourcesRequested(limit: kDefaultRowsPerPage));
63+
add(const LoadSourcesRequested(
64+
limit: kDefaultRowsPerPage,
65+
forceRefresh: true,
66+
));
5867
});
5968
}
6069

0 commit comments

Comments
 (0)