π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Show descriptive dialogs on StorageLimitExceededError and FileTooLargeForPlanError for locker
ashilknd7564f1ecd5b
diff --git a/mobile/apps/locker/lib/l10n/app_en.arb b/mobile/apps/locker/lib/l10n/app_en.arbindex b9f15580c1..1467e85c40 100644--- a/mobile/apps/locker/lib/l10n/app_en.arb+++ b/mobile/apps/locker/lib/l10n/app_en.arb@@ -594,6 +594,22 @@"legacy": "Legacy","authToManageLegacy": "Please authenticate to manage your trusted contacts","uploadError": "Upload error",+ "uploadStorageLimitErrorTitle": "Storage limit reached",+ "@uploadStorageLimitErrorTitle": {+ "description": "Title shown when uploads fail due to running out of storage"+ },+ "uploadStorageLimitErrorBody": "You've run out of storage space. Please remove items or upgrade your plan to continue uploading.",+ "@uploadStorageLimitErrorBody": {+ "description": "Body shown when uploads fail due to running out of storage"+ },+ "uploadFileTooLargeErrorTitle": "File too large",+ "@uploadFileTooLargeErrorTitle": {+ "description": "Title shown when uploads fail because the file exceeds the supported size"+ },+ "uploadFileTooLargeErrorBody": "This file is larger than the maximum supported upload size of 10GB.",+ "@uploadFileTooLargeErrorBody": {+ "description": "Body shown when uploads fail because the file exceeds the supported size"+ },"tryAdjustingYourSearchQuery": "Try adjusting your search query","noFilesFoundForQuery": "No items found for \"{query}\"","@noFilesFoundForQuery": {diff --git a/mobile/apps/locker/lib/l10n/app_localizations.dart b/mobile/apps/locker/lib/l10n/app_localizations.dartindex 2bf04d322e..31f73511d2 100644--- a/mobile/apps/locker/lib/l10n/app_localizations.dart+++ b/mobile/apps/locker/lib/l10n/app_localizations.dart@@ -2014,6 +2014,30 @@ abstract class AppLocalizations {/// **'Upload error'**String get uploadError;+ /// Title shown when uploads fail due to running out of storage+ ///+ /// In en, this message translates to:+ /// **'Storage limit reached'**+ String get uploadStorageLimitErrorTitle;++ /// Body shown when uploads fail due to running out of storage+ ///+ /// In en, this message translates to:+ /// **'You\'ve run out of storage space. Please remove items or upgrade your plan to continue uploading.'**+ String get uploadStorageLimitErrorBody;++ /// Title shown when uploads fail because the file exceeds the supported size+ ///+ /// In en, this message translates to:+ /// **'File too large'**+ String get uploadFileTooLargeErrorTitle;++ /// Body shown when uploads fail because the file exceeds the supported size+ ///+ /// In en, this message translates to:+ /// **'This file is larger than the maximum supported upload size of 10GB.'**+ String get uploadFileTooLargeErrorBody;+/// No description provided for @tryAdjustingYourSearchQuery.////// In en, this message translates to:@@ -2233,13 +2257,13 @@ abstract class AppLocalizations {/// No description provided for @unlockLockerPaidPlanTitle.////// In en, this message translates to:- /// **'Coming soon!'**+ /// **'Unlock Locker with a paid plan.'**String get unlockLockerPaidPlanTitle;/// No description provided for @unlockLockerPaidPlanBody.////// In en, this message translates to:- /// **'Locker is currently available only to paid customers of Ente Photos.'**+ /// **'Locker is available only to Ente photos paid users. Upgrade to a paid plan from Photos to use Locker'**String get unlockLockerPaidPlanBody;/// No description provided for @checkoutEntePhotos.diff --git a/mobile/apps/locker/lib/l10n/app_localizations_en.dart b/mobile/apps/locker/lib/l10n/app_localizations_en.dartindex d232f45145..cd6f984b24 100644--- a/mobile/apps/locker/lib/l10n/app_localizations_en.dart+++ b/mobile/apps/locker/lib/l10n/app_localizations_en.dart@@ -1128,6 +1128,20 @@ class AppLocalizationsEn extends AppLocalizations {@overrideString get uploadError => 'Upload error';+ @override+ String get uploadStorageLimitErrorTitle => 'Storage limit reached';++ @override+ String get uploadStorageLimitErrorBody =>+ 'You\'ve run out of storage space. Please remove items or upgrade your plan to continue uploading.';++ @override+ String get uploadFileTooLargeErrorTitle => 'File too large';++ @override+ String get uploadFileTooLargeErrorBody =>+ 'This file is larger than the maximum supported upload size of 10GB.';+@overrideString get tryAdjustingYourSearchQuery => 'Try adjusting your search query';@@ -1273,11 +1287,11 @@ class AppLocalizationsEn extends AppLocalizations {String get loginToEnteAccount => 'Log in to your Ente account';@override- String get unlockLockerPaidPlanTitle => 'Coming soon!';+ String get unlockLockerPaidPlanTitle => 'Unlock Locker with a paid plan.';@overrideString get unlockLockerPaidPlanBody =>- 'Locker is currently available only to paid customers of Ente Photos.';+ 'Locker is available only to Ente photos paid users. Upgrade to a paid plan from Photos to use Locker';@overrideString get checkoutEntePhotos => 'Checkout Ente Photos';diff --git a/mobile/apps/locker/lib/ui/pages/uploader_page.dart b/mobile/apps/locker/lib/ui/pages/uploader_page.dartindex bb25af6c87..b9197c58b0 100644--- a/mobile/apps/locker/lib/ui/pages/uploader_page.dart+++ b/mobile/apps/locker/lib/ui/pages/uploader_page.dart@@ -4,6 +4,7 @@ import 'package:ente_ui/pages/base_home_page.dart';import 'package:ente_ui/utils/dialog_util.dart';import 'package:file_picker/file_picker.dart';import 'package:flutter/material.dart';+import 'package:locker/core/errors.dart';import "package:locker/l10n/l10n.dart";import 'package:locker/services/collections/collections_service.dart';import 'package:locker/services/collections/models/collection.dart';@@ -159,10 +160,26 @@ abstract class UploaderPageState<T extends UploaderPage> extends State<T> {if (progressDialog.isShowing()) {await progressDialog.hide();}- await showGenericErrorDialog(- context: context,- error: e,- );+ if (e is StorageLimitExceededError) {+ await showErrorDialog(+ context,+ context.l10n.uploadStorageLimitErrorTitle,+ context.l10n.uploadStorageLimitErrorBody,+ isDismissable: true,+ );+ } else if (e is FileTooLargeForPlanError) {+ await showErrorDialog(+ context,+ context.l10n.uploadFileTooLargeErrorTitle,+ context.l10n.uploadFileTooLargeErrorBody,+ isDismissable: true,+ );+ } else {+ await showGenericErrorDialog(+ context: context,+ error: e,+ );+ }} finally {if (progressDialog.isShowing()) {await progressDialog.hide();