File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
lib/headlines-search/bloc Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -112,7 +112,12 @@ class HeadlinesSearchBloc
112
112
cursor: response.cursor,
113
113
),
114
114
);
115
- break ; // Added break
115
+ // Dispatch event if AccountAction was injected during pagination
116
+ if (injectedItems.any ((item) => item is AccountAction ) &&
117
+ _appBloc.state.user? .id != null ) {
118
+ _appBloc.add (AppUserAccountActionShown (userId: _appBloc.state.user! .id));
119
+ }
120
+ break ;
116
121
case SearchModelType .category:
117
122
response = await _categoryRepository.readAllByQuery (
118
123
{'q' : searchTerm, 'model' : modelType.toJson ()},
@@ -208,13 +213,19 @@ class HeadlinesSearchBloc
208
213
}
209
214
emit (
210
215
HeadlinesSearchSuccess (
211
- items: processedItems, // Changed
216
+ items: processedItems,
212
217
hasMore: rawResponse.hasMore,
213
218
cursor: rawResponse.cursor,
214
219
lastSearchTerm: searchTerm,
215
220
selectedModelType: modelType,
216
221
),
217
222
);
223
+ // Dispatch event if AccountAction was injected in new search
224
+ if (modelType == SearchModelType .headline &&
225
+ processedItems.any ((item) => item is AccountAction ) &&
226
+ _appBloc.state.user? .id != null ) {
227
+ _appBloc.add (AppUserAccountActionShown (userId: _appBloc.state.user! .id));
228
+ }
218
229
} on HtHttpException catch (e) {
219
230
emit (
220
231
HeadlinesSearchFailure (
You can’t perform that action at this time.
0 commit comments