fix: Devices and Recovery Key cubits couldn't initialize right after server installation

This commit is contained in:
inexcode 2023-02-23 17:37:23 +03:00 committed by Gitea
parent 0b3b46b452
commit 54513998ce
2 changed files with 16 additions and 16 deletions

View file

@ -15,9 +15,9 @@ class ApiDevicesCubit
@override @override
void load() async { void load() async {
if (serverInstallationCubit.state is ServerInstallationFinished) { // if (serverInstallationCubit.state is ServerInstallationFinished) {
_refetch(); _refetch();
} // }
} }
Future<void> refresh() async { Future<void> refresh() async {

View file

@ -14,7 +14,7 @@ class RecoveryKeyCubit
@override @override
void load() async { void load() async {
if (serverInstallationCubit.state is ServerInstallationFinished) { // if (serverInstallationCubit.state is ServerInstallationFinished) {
final RecoveryKeyStatus? status = await _getRecoveryKeyStatus(); final RecoveryKeyStatus? status = await _getRecoveryKeyStatus();
if (status == null) { if (status == null) {
emit(state.copyWith(loadingStatus: LoadingStatus.error)); emit(state.copyWith(loadingStatus: LoadingStatus.error));
@ -26,9 +26,9 @@ class RecoveryKeyCubit
), ),
); );
} }
} else { // } else {
emit(state.copyWith(loadingStatus: LoadingStatus.uninitialized)); // emit(state.copyWith(loadingStatus: LoadingStatus.uninitialized));
} // }
} }
Future<RecoveryKeyStatus?> _getRecoveryKeyStatus() async { Future<RecoveryKeyStatus?> _getRecoveryKeyStatus() async {