Skip to content

armgit / ente

Public Imported from GitHub
0

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

[mob] Show total memory count to upload

Neeraj Gupta187a149716a4
diff --git a/mobile/lib/services/remote_sync_service.dart b/mobile/lib/services/remote_sync_service.dart
index eab8478a6c..c1348ba45f 100644
--- a/mobile/lib/services/remote_sync_service.dart
+++ b/mobile/lib/services/remote_sync_service.dart
@@ -581,7 +581,9 @@ class RemoteSyncService {
_ignoredUploads = 0;
final int toBeUploaded = filesToBeUploaded.length + updatedFileIDs.length;
if (toBeUploaded > 0) {
- Bus.instance.fire(SyncStatusUpdate(SyncStatus.preparingForUpload));
+ Bus.instance.fire(
+ SyncStatusUpdate(SyncStatus.preparingForUpload, total: toBeUploaded),
+ );
await _uploader.verifyMediaLocationAccess();
await _uploader.checkNetworkForUpload();
// verify if files upload is allowed based on their subscription plan and
diff --git a/mobile/lib/ui/home/status_bar_widget.dart b/mobile/lib/ui/home/status_bar_widget.dart
index 461a92a1c9..d676a42945 100644
--- a/mobile/lib/ui/home/status_bar_widget.dart
+++ b/mobile/lib/ui/home/status_bar_widget.dart
@@ -231,6 +231,9 @@ class RefreshIndicatorWidget extends StatelessWidget {
}
String _getRefreshingText(BuildContext context) {
+ if (event == null) {
+ return S.of(context).loadingGallery;
+ }
if (event!.status == SyncStatus.startedFirstGalleryImport ||
event!.status == SyncStatus.completedFirstGalleryImport) {
return S.of(context).loadingGallery;
@@ -239,7 +242,15 @@ class RefreshIndicatorWidget extends StatelessWidget {
return S.of(context).syncing;
}
if (event!.status == SyncStatus.preparingForUpload) {
- return S.of(context).encryptingBackup;
+ if (event!.total == null || event!.total! <= 0) {
+ return S.of(context).encryptingBackup;
+ } else if (event!.total == 1) {
+ return S.of(context).uploadingSingleMemory;
+ } else {
+ return S
+ .of(context)
+ .uploadingMultipleMemories(NumberFormat().format(event!.total!));
+ }
}
if (event!.status == SyncStatus.inProgress) {
final format = NumberFormat();