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

pull/203/head
Inex Code 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
void load() async {
if (serverInstallationCubit.state is ServerInstallationFinished) {
_refetch();
}
// if (serverInstallationCubit.state is ServerInstallationFinished) {
_refetch();
// }
}
Future<void> refresh() async {

View File

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