Skip to content

Commit 1cb0247

Browse files
committed
refactor(headlines-feed): improve variable naming and filter logic
- Rename `availableCountries` to `countriesWithActiveSources` for clarity - Update filter parameter from `usage` to `hasActiveSources` for better readability - Adjust variable assignments and emit statements to reflect new variable names
1 parent d60d801 commit 1cb0247

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/headlines-feed/bloc/sources_filter_bloc.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ class SourcesFilterBloc extends Bloc<SourcesFilterEvent, SourcesFilterState> {
4545
state.copyWith(dataLoadingStatus: SourceFilterDataLoadingStatus.loading),
4646
);
4747
try {
48-
final availableCountries = (await _countriesRepository.readAll(
49-
filter: {'usage': 'hasActiveHeadlines'},
48+
final countriesWithActiveSources = (await _countriesRepository.readAll(
49+
filter: {'hasActiveSources': 'true'},
5050
)).items;
5151
final initialSelectedSourceIds = event.initialSelectedSources
5252
.map((s) => s.id)
@@ -71,7 +71,7 @@ class SourcesFilterBloc extends Bloc<SourcesFilterEvent, SourcesFilterState> {
7171

7272
emit(
7373
state.copyWith(
74-
availableCountries: availableCountries,
74+
countriesWithActiveSources: countriesWithActiveSources,
7575
allAvailableSources: allAvailableSources,
7676
displayableSources: displayableSources,
7777
finallySelectedSourceIds: initialSelectedSourceIds,

0 commit comments

Comments
 (0)