mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2025-01-09 01:21:14 +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
|
@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 {
|
||||||
|
|
|
@ -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 {
|
||||||
|
|
Loading…
Reference in a new issue