π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Replace error_bottom_sheet with alert_bottom_sheet in multiple files
AmanRajSinghMouryadb1ab1e98513
diff --git a/mobile/packages/legacy/lib/pages/emergency_page.dart b/mobile/packages/legacy/lib/pages/emergency_page.dartindex 6c801bdd6d..d165200d33 100644--- a/mobile/packages/legacy/lib/pages/emergency_page.dart+++ b/mobile/packages/legacy/lib/pages/emergency_page.dart@@ -1,7 +1,7 @@import "dart:async";import "package:ente_configuration/base_configuration.dart";-import "package:ente_legacy/components/confirmation_bottom_sheet.dart";+import "package:ente_legacy/components/alert_bottom_sheet.dart";import "package:ente_legacy/components/gradient_button.dart";import "package:ente_legacy/components/invite_bottom_sheet.dart";import "package:ente_legacy/components/trusted_contact_bottom_sheet.dart";@@ -407,7 +407,8 @@ class _EmergencyPageState extends State<EmergencyPage> {if (result?.action == TrustedContactAction.revoke) {final isPending = contact.isPendingInvite();- final confirmed = await showConfirmationBottomSheet(+ final colorScheme = getEnteColorScheme(context);+ final confirmed = await showAlertBottomSheet<bool>(context,title: isPending? context.strings.cancelInviteTitle@@ -415,13 +416,22 @@ class _EmergencyPageState extends State<EmergencyPage> {message: isPending? context.strings.cancelInviteMessage: context.strings.removeContactMessage,- buttonText: isPending- ? context.strings.revokeInvite- : context.strings.removeContact,assetPath: "assets/warning-grey.png",+ buttons: [+ SizedBox(+ width: double.infinity,+ child: GradientButton(+ text: isPending+ ? context.strings.revokeInvite+ : context.strings.removeContact,+ backgroundColor: colorScheme.warning700,+ onTap: () => Navigator.of(context).pop(true),+ ),+ ),+ ],);- if (confirmed == true) {+ if (confirmed!) {await EmergencyContactService.instance.updateContact(contact, ContactState.userRevokedContact);info?.contacts.remove(contact);diff --git a/mobile/packages/legacy/lib/pages/select_contact_page.dart b/mobile/packages/legacy/lib/pages/select_contact_page.dartindex 165280adf4..b0210e196c 100644--- a/mobile/packages/legacy/lib/pages/select_contact_page.dart+++ b/mobile/packages/legacy/lib/pages/select_contact_page.dart@@ -1,7 +1,7 @@import "package:email_validator/email_validator.dart";import "package:ente_accounts/services/user_service.dart";import "package:ente_configuration/base_configuration.dart";-import "package:ente_legacy/components/error_bottom_sheet.dart";+import "package:ente_legacy/components/alert_bottom_sheet.dart";import "package:ente_legacy/components/gradient_button.dart";import "package:ente_legacy/models/emergency_models.dart";import "package:ente_legacy/services/emergency_service.dart";@@ -108,7 +108,7 @@ class _AddContactBottomSheetState extends State<AddContactBottomSheet> {_buildRecoveryTimeSection(colorScheme, textTheme),const SizedBox(height: 20),_buildAddContactButton(textTheme),- const SizedBox(height: 20),+ const SizedBox(height: 12),_buildVerifyLink(textTheme),],),@@ -415,7 +415,7 @@ class _AddContactBottomSheetState extends State<AddContactBottomSheet> {} catch (e) {_logger.severe("Failed to add contact", e);if (mounted) {- await showErrorBottomSheet(+ await showAlertBottomSheet(context,title: context.strings.error,message: context.strings.somethingWentWrong,@@ -539,7 +539,7 @@ class _AddContactBottomSheetState extends State<AddContactBottomSheet> {Future<void> _onVerifyTap() async {if (selectedEmail.isEmpty && !_emailIsValid) {- await showErrorBottomSheet(+ await showAlertBottomSheet(context,title: context.strings.invalidEmailAddress,message: context.strings.enterValidEmail,diff --git a/mobile/packages/legacy/lib/services/emergency_service.dart b/mobile/packages/legacy/lib/services/emergency_service.dartindex 1362af6df9..d0ad15048a 100644--- a/mobile/packages/legacy/lib/services/emergency_service.dart+++ b/mobile/packages/legacy/lib/services/emergency_service.dart@@ -9,7 +9,7 @@ import "package:ente_accounts/services/user_service.dart";import "package:ente_base/models/key_attributes.dart";import "package:ente_configuration/base_configuration.dart";import "package:ente_crypto_dart/ente_crypto_dart.dart";-import "package:ente_legacy/components/error_bottom_sheet.dart";+import "package:ente_legacy/components/alert_bottom_sheet.dart";import "package:ente_legacy/models/emergency_models.dart";import "package:ente_network/network.dart";import "package:ente_sharing/components/invite_dialog.dart";@@ -49,7 +49,7 @@ class EmergencyContactService {int recoveryNoticeInDays,) async {if (!isValidEmail(email)) {- await showErrorBottomSheet(+ await showAlertBottomSheet(context,title: context.strings.letsTryThatAgain,message: context.strings.enterValidEmail,@@ -57,7 +57,7 @@ class EmergencyContactService {);return false;} else if (email.trim() == _config.getEmail()) {- await showErrorBottomSheet(+ await showAlertBottomSheet(context,title: context.strings.oops,message: context.strings.youCannotShareWithYourself,