Skip to content

armgit / ente

Public Imported from GitHub
0

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

add settings item to keep Ente awake during large backups

AmanRajSinghMouryad219f156bdea
diff --git a/mobile/apps/photos/lib/ui/settings/backup/backup_settings_screen.dart b/mobile/apps/photos/lib/ui/settings/backup/backup_settings_screen.dart
index c994e9c54a..b72ad07a66 100644
--- a/mobile/apps/photos/lib/ui/settings/backup/backup_settings_screen.dart
+++ b/mobile/apps/photos/lib/ui/settings/backup/backup_settings_screen.dart
@@ -4,12 +4,15 @@ import "package:ente_components/ente_components.dart";
import "package:ente_pure_utils/ente_pure_utils.dart";
import "package:ente_strings/ente_strings.dart";
import "package:flutter/material.dart";
+import "package:hugeicons/hugeicons.dart";
import "package:photo_manager/photo_manager.dart";
import "package:photos/service_locator.dart";
import "package:photos/services/sync/local_sync_service.dart";
import "package:photos/services/sync/sync_service.dart";
import "package:photos/services/wake_lock_service.dart";
import "package:photos/ui/common/backup_flow_helper.dart";
+import "package:photos/ui/home/large_backup_screen.dart";
+import "package:photos/ui/settings/components/settings_item.dart";
import "package:photos/ui/settings/components/settings_page_scaffold.dart";
import "package:photos/utils/dialog_util.dart";
@@ -92,13 +95,18 @@ class BackupSettingsScreen extends StatelessWidget {
if (Platform.isIOS) ...[
const SizedBox(height: 24),
if (flagService.largeBackupStandby) ...[
- _toggleItem(
- context,
- title: pendingTranslation("(i) Enable large backup standby"),
- value: () => localSettings.isLargeBackupStandbyEnabled,
- onChanged: () async {
- await localSettings.setLargeBackupStandbyEnabled(
- !localSettings.isLargeBackupStandbyEnabled,
+ SettingsItem(
+ title: pendingTranslation("(i) Keep Ente awake"),
+ subtitle: pendingTranslation(
+ "Dim the screen while a large backup finishes",
+ ),
+ icon: HugeIcons.strokeRoundedMoon02,
+ showOnlyLoadingState: true,
+ onTap: () {
+ return showLargeBackupScreen(
+ context,
+ SyncService.instance.largeBackupSessionTracker,
+ allowWithoutActiveBackup: true,
);
},
),