fix: Improve backups initialization
parent
a27f6b8f4d
commit
6496720ffa
|
@ -15,7 +15,7 @@ class BackupsWizardCubit extends Cubit<BackupsWizardState> {
|
|||
|
||||
/// If config already exists, then user only lacks credentials,
|
||||
/// we don't need full re-initialization
|
||||
if (serverBackupConfig != null) {
|
||||
if (serverBackupConfig != null && serverBackupConfig.isInitialized) {
|
||||
emit(state.copyWith(currentStep: BackupsWizardStep.hostingRecovery));
|
||||
}
|
||||
}
|
||||
|
@ -54,12 +54,4 @@ class BackupsWizardCubit extends Cubit<BackupsWizardState> {
|
|||
),
|
||||
);
|
||||
}
|
||||
|
||||
void finish() async {
|
||||
emit(
|
||||
state.copyWith(
|
||||
currentStep: BackupsWizardStep.finished,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,5 +44,4 @@ enum BackupsWizardStep {
|
|||
settingsInitialization,
|
||||
confirmInitialization,
|
||||
confirmRecovery,
|
||||
finished,
|
||||
}
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
import 'package:cubit_form/cubit_form.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:selfprivacy/logic/cubit/backups_wizard/backups_wizard_cubit.dart';
|
||||
import 'package:selfprivacy/ui/components/buttons/brand_button.dart';
|
||||
import 'package:selfprivacy/ui/layouts/responsive_layout_with_infobox.dart';
|
||||
|
||||
|
@ -31,7 +29,6 @@ class BackupConfirmationPage extends StatelessWidget {
|
|||
BrandButton.rised(
|
||||
onPressed: () {
|
||||
onConfirmCallback();
|
||||
context.read<BackupsWizardCubit>().finish();
|
||||
},
|
||||
text: 'basis.connect'.tr(),
|
||||
),
|
||||
|
|
|
@ -83,7 +83,8 @@ class BackupsInitializingPage extends StatelessWidget {
|
|||
|
||||
return BlocListener<BackupsWizardCubit, BackupsWizardState>(
|
||||
listener: (final context, final state) {
|
||||
if (cubit.state.currentStep == BackupsWizardStep.finished) {
|
||||
if (context.watch<BackupsState>().backupsCredential != null &&
|
||||
context.watch<BackupsState>().backblazeBucket != null) {
|
||||
context.router.popUntilRoot();
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue