Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

fix: update backup failed dialog to make UX better

Prateek Sunal05a42efb1b30
diff --git a/mobile/lib/l10n/intl_en.arb b/mobile/lib/l10n/intl_en.arb
index d01df436c2..cab5da3cf6 100644
--- a/mobile/lib/l10n/intl_en.arb
+++ b/mobile/lib/l10n/intl_en.arb
@@ -721,6 +721,7 @@
"type": "text"
},
"backupFailed": "Backup failed",
+ "sorryBackupFailedDesc": "Sorry, we could not backup this file right now, we will retry later.",
"couldNotBackUpTryLater": "We could not backup your data.\nWe will retry later.",
"enteCanEncryptAndPreserveFilesOnlyIfYouGrant": "Ente can encrypt and preserve files only if you grant access to them",
"pleaseGrantPermissions": "Please grant permissions",
diff --git a/mobile/lib/ui/settings/backup/backup_item_card.dart b/mobile/lib/ui/settings/backup/backup_item_card.dart
index c8f27b32bc..ff50a5dfe0 100644
--- a/mobile/lib/ui/settings/backup/backup_item_card.dart
+++ b/mobile/lib/ui/settings/backup/backup_item_card.dart
@@ -1,12 +1,16 @@
import "dart:async";
import 'package:flutter/material.dart';
+import "package:photos/generated/l10n.dart";
import "package:photos/models/backup/backup_item.dart";
import "package:photos/models/backup/backup_item_status.dart";
import 'package:photos/theme/ente_theme.dart';
+import "package:photos/ui/components/buttons/button_widget.dart";
+import "package:photos/ui/components/dialog_widget.dart";
+import "package:photos/ui/components/models/button_type.dart";
import "package:photos/ui/viewer/file/detail_page.dart";
import "package:photos/ui/viewer/file/thumbnail_widget.dart";
-import "package:photos/utils/dialog_util.dart";
+import "package:photos/utils/email_util.dart";
import "package:photos/utils/file_uploader.dart";
import "package:photos/utils/navigation_util.dart";
@@ -137,17 +141,36 @@ class _BackupItemCardState extends State<BackupItemCard> {
color: getEnteColorScheme(context).fillBase,
),
onPressed: () {
- String errorMessage = "";
- if (widget.item.error is Exception) {
- final Exception ex = widget.item.error as Exception;
- errorMessage = "Error: " +
- ex.runtimeType.toString() +
- " - " +
- ex.toString();
- } else if (widget.item.error != null) {
- errorMessage = widget.item.error.toString();
- }
- showErrorDialog(context, 'Upload failed', errorMessage);
+ showDialogWidget(
+ context: context,
+ body: S.of(context).sorryBackupFailedDesc,
+ title: S.of(context).backupFailed,
+ icon: Icons.error_outline_outlined,
+ isDismissible: true,
+ buttons: [
+ ButtonWidget(
+ buttonType: ButtonType.primary,
+ labelText: S.of(context).contactSupport,
+ buttonAction: ButtonAction.second,
+ onTap: () async {
+ await sendLogs(
+ context,
+ S.of(context).contactSupport,
+ postShare: () {},
+ );
+ },
+ ),
+ ButtonWidget(
+ buttonType: ButtonType.secondary,
+ labelText: S.of(context).ok,
+ buttonAction: ButtonAction.first,
+ onTap: () async {
+ Navigator.of(context).pop();
+ },
+ ),
+ ],
+ );
},
),
),