We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 69f73d3 commit 6c020a9Copy full SHA for 6c020a9
lib/content_management/bloc/content_management_bloc.dart
@@ -263,6 +263,14 @@ class ContentManagementBloc
263
LoadSourcesRequested event,
264
Emitter<ContentManagementState> emit,
265
) async {
266
+ // If sources are already loaded and it's not a pagination request,
267
+ // do not re-fetch. This prevents redundant API calls on tab changes.
268
+ if (state.sourcesStatus == ContentManagementStatus.success &&
269
+ state.sources.isNotEmpty &&
270
+ event.startAfterId == null) {
271
+ return;
272
+ }
273
+
274
emit(state.copyWith(sourcesStatus: ContentManagementStatus.loading));
275
try {
276
final isPaginating = event.startAfterId != null;
0 commit comments