WIP - more decoupling of blocs

This commit is contained in:
Anton Stubenbord
2022-12-12 01:29:34 +01:00
parent e2a20cea75
commit 2f31d9c053
51 changed files with 1083 additions and 800 deletions

View File

@@ -81,7 +81,8 @@ class AuthenticationCubit extends Cubit<AuthenticationState> {
appSettings = ApplicationSettingsState.defaultSettings;
}
if (storedAuth == null || !storedAuth.isValid) {
emit(AuthenticationState(isAuthenticated: false, wasLoginStored: false));
return emit(
AuthenticationState(isAuthenticated: false, wasLoginStored: false));
} else {
if (appSettings.isLocalAuthenticationEnabled) {
final localAuthSuccess = await _localAuthService
@@ -103,8 +104,13 @@ class AuthenticationCubit extends Cubit<AuthenticationState> {
wasLocalAuthenticationSuccessful: false,
));
}
} else {
return emit(AuthenticationState(
isAuthenticated: true,
authentication: storedAuth,
wasLoginStored: true,
));
}
emit(AuthenticationState(isAuthenticated: false, wasLoginStored: true));
}
}