Skip to content

Commit 127e012

Browse files
committed
refactor(app): improve remote config handling and logging
- Replace hardcoded 'app_config' with constant kRemoteConfigId - Rename variable 'appConfig' to 'remoteConfig' for clarity - Update log message to use 'Remote Config' instead of 'AppConfig' - Improve code readability by formatting the emit statement
1 parent bbf5668 commit 127e012

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

lib/app/bloc/app_bloc.dart

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -432,9 +432,9 @@ class AppBloc extends Bloc<AppEvent, AppState> {
432432
);
433433

434434
try {
435-
final appConfig = await _appConfigRepository.read(id: 'app_config');
435+
final remoteConfig = await _appConfigRepository.read(id: kRemoteConfigId);
436436
print(
437-
'[AppBloc] AppConfig fetched successfully. ID: ${appConfig.id} for user: ${state.user!.id}',
437+
'[AppBloc] Remote Config fetched successfully. ID: ${remoteConfig.id} for user: ${state.user!.id}',
438438
);
439439

440440
// Determine the correct status based on the existing user's role.
@@ -444,7 +444,10 @@ class AppBloc extends Bloc<AppEvent, AppState> {
444444
? AppStatus.authenticated
445445
: AppStatus.anonymous;
446446
emit(
447-
state.copyWith(remoteConfig: appConfig, status: newStatusBasedOnUser),
447+
state.copyWith(
448+
remoteConfig: remoteConfig,
449+
status: newStatusBasedOnUser,
450+
),
448451
);
449452
} on HtHttpException catch (e) {
450453
print(

0 commit comments

Comments
 (0)