mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2025-01-23 09:16:54 +00:00
fix: Improve installation failure dialogues
This commit is contained in:
parent
da4b38b787
commit
0d55361a9b
|
@ -262,32 +262,32 @@ class ServerInstallationCubit extends Cubit<ServerInstallationState> {
|
|||
if (!result.success && result.data != null) {
|
||||
bool dialoguesResolved = false;
|
||||
CallbackDialogueBranching branching = result.data!;
|
||||
while (!dialoguesResolved) {
|
||||
showPopUpAlert(
|
||||
alertTitle: branching.title,
|
||||
description: branching.description,
|
||||
actionButtonTitle: branching.choices[1].title,
|
||||
actionButtonOnPressed: () async {
|
||||
final branchingResult = await branching.choices[1].callback!();
|
||||
if (branchingResult.data == null) {
|
||||
dialoguesResolved = true;
|
||||
return;
|
||||
}
|
||||
//while (!dialoguesResolved) {
|
||||
showPopUpAlert(
|
||||
alertTitle: branching.title,
|
||||
description: branching.description,
|
||||
actionButtonTitle: branching.choices[1].title,
|
||||
actionButtonOnPressed: () async {
|
||||
final branchingResult = await branching.choices[1].callback!();
|
||||
if (branchingResult.data == null) {
|
||||
dialoguesResolved = true;
|
||||
return;
|
||||
}
|
||||
|
||||
branching = branchingResult.data!;
|
||||
},
|
||||
cancelButtonTitle: branching.choices[0].title,
|
||||
cancelButtonOnPressed: () async {
|
||||
final branchingResult = await branching.choices[0].callback!();
|
||||
if (branchingResult.data == null) {
|
||||
dialoguesResolved = true;
|
||||
return;
|
||||
}
|
||||
branching = branchingResult.data!;
|
||||
},
|
||||
cancelButtonTitle: branching.choices[0].title,
|
||||
cancelButtonOnPressed: () async {
|
||||
final branchingResult = await branching.choices[0].callback!();
|
||||
if (branchingResult.data == null) {
|
||||
dialoguesResolved = true;
|
||||
return;
|
||||
}
|
||||
|
||||
branching = branchingResult.data!;
|
||||
},
|
||||
);
|
||||
}
|
||||
branching = branchingResult.data!;
|
||||
},
|
||||
);
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -159,10 +159,10 @@ class DigitalOceanServerProvider extends ServerProvider {
|
|||
choices: [
|
||||
CallbackDialogueChoice(
|
||||
title: 'basis.cancel'.tr(),
|
||||
callback: await installationData.errorCallback(),
|
||||
callback: () async => await installationData.errorCallback(),
|
||||
),
|
||||
CallbackDialogueChoice(
|
||||
title: 'basis.try_again'.tr(),
|
||||
title: 'modals.try_again'.tr(),
|
||||
callback: () async => launchInstallation(installationData),
|
||||
),
|
||||
],
|
||||
|
@ -215,7 +215,7 @@ class DigitalOceanServerProvider extends ServerProvider {
|
|||
callback: null,
|
||||
),
|
||||
CallbackDialogueChoice(
|
||||
title: 'basis.try_again'.tr(),
|
||||
title: 'modals.try_again'.tr(),
|
||||
callback: () async {
|
||||
await Future.delayed(const Duration(seconds: 5));
|
||||
final deletion = await deleteServer(hostname);
|
||||
|
@ -595,7 +595,7 @@ class DigitalOceanServerProvider extends ServerProvider {
|
|||
callback: null,
|
||||
),
|
||||
CallbackDialogueChoice(
|
||||
title: 'basis.try_again'.tr(),
|
||||
title: 'modals.try_again'.tr(),
|
||||
callback: () async {
|
||||
await Future.delayed(const Duration(seconds: 5));
|
||||
return deleteServer(hostname);
|
||||
|
|
|
@ -418,10 +418,10 @@ class HetznerServerProvider extends ServerProvider {
|
|||
choices: [
|
||||
CallbackDialogueChoice(
|
||||
title: 'basis.cancel'.tr(),
|
||||
callback: await installationData.errorCallback(),
|
||||
callback: () async => await installationData.errorCallback(),
|
||||
),
|
||||
CallbackDialogueChoice(
|
||||
title: 'basis.try_again'.tr(),
|
||||
title: 'modals.try_again'.tr(),
|
||||
callback: () async => launchInstallation(installationData),
|
||||
),
|
||||
],
|
||||
|
@ -467,10 +467,10 @@ class HetznerServerProvider extends ServerProvider {
|
|||
choices: [
|
||||
CallbackDialogueChoice(
|
||||
title: 'basis.cancel'.tr(),
|
||||
callback: installationData.errorCallback(),
|
||||
callback: () async => installationData.errorCallback(),
|
||||
),
|
||||
CallbackDialogueChoice(
|
||||
title: 'basis.yes'.tr(),
|
||||
title: 'modals.yes'.tr(),
|
||||
callback: () async {
|
||||
final deleting = await deleteServer(hostname);
|
||||
if (deleting.success) {
|
||||
|
@ -481,7 +481,7 @@ class HetznerServerProvider extends ServerProvider {
|
|||
},
|
||||
),
|
||||
],
|
||||
description: volumeResult.message ?? 'modals.destroy_server'.tr(),
|
||||
description: 'modals.destroy_server'.tr(),
|
||||
title: 'modals.already_exists'.tr(),
|
||||
),
|
||||
success: false,
|
||||
|
@ -504,7 +504,7 @@ class HetznerServerProvider extends ServerProvider {
|
|||
},
|
||||
),
|
||||
CallbackDialogueChoice(
|
||||
title: 'basis.try_again'.tr(),
|
||||
title: 'modals.try_again'.tr(),
|
||||
callback: () async => launchInstallation(installationData),
|
||||
),
|
||||
],
|
||||
|
@ -556,7 +556,7 @@ class HetznerServerProvider extends ServerProvider {
|
|||
},
|
||||
),
|
||||
CallbackDialogueChoice(
|
||||
title: 'basis.try_again'.tr(),
|
||||
title: 'modals.try_again'.tr(),
|
||||
callback: () async {
|
||||
await _adapter.api().deleteVolume(volume['id']);
|
||||
await Future.delayed(const Duration(seconds: 5));
|
||||
|
@ -631,7 +631,7 @@ class HetznerServerProvider extends ServerProvider {
|
|||
callback: null,
|
||||
),
|
||||
CallbackDialogueChoice(
|
||||
title: 'basis.try_again'.tr(),
|
||||
title: 'modals.try_again'.tr(),
|
||||
callback: () async {
|
||||
await Future.delayed(const Duration(seconds: 5));
|
||||
return deleteServer(hostname);
|
||||
|
|
Loading…
Reference in a new issue