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 @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,21 +14,21 @@ 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));
} else {
emit(
state.copyWith(
status: status,
loadingStatus: LoadingStatus.success,
),
);
}
} else { } 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 { Future<RecoveryKeyStatus?> _getRecoveryKeyStatus() async {