mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2025-01-08 00:51:20 +00:00
fix: Devices and Recovery Key cubits couldn't initialize right after server installation
This commit is contained in:
parent
0b3b46b452
commit
54513998ce
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue