Skip to content

High performance self-hosted photo and video management solution.

chore(mobile): only enable wakelock when backup is running (#11849)

Saschl1c754b60dc2a
diff --git a/mobile/lib/pages/backup/backup_controller.page.dart b/mobile/lib/pages/backup/backup_controller.page.dart
index 7b86f3225c..bb9d462e50 100644
--- a/mobile/lib/pages/backup/backup_controller.page.dart
+++ b/mobile/lib/pages/backup/backup_controller.page.dart
@@ -51,8 +51,8 @@ class BackupControllerPage extends HookConsumerWidget {
}
void stopScreenDarkenTimer() {
- isScreenDarkened.value = false;
darkenScreenTimer.value?.cancel();
+ isScreenDarkened.value = false;
SystemChrome.setEnabledSystemUIMode(
SystemUiMode.manual,
overlays: [
@@ -75,8 +75,6 @@ class BackupControllerPage extends HookConsumerWidget {
.watch(websocketProvider.notifier)
.stopListenToEvent('on_upload_success');
- WakelockPlus.enable();
-
return () {
WakelockPlus.disable();
darkenScreenTimer.value?.cancel();
@@ -102,8 +100,10 @@ class BackupControllerPage extends HookConsumerWidget {
() {
if (backupState.backupProgress == BackUpProgressEnum.inProgress) {
startScreenDarkenTimer();
+ WakelockPlus.enable();
} else {
stopScreenDarkenTimer();
+ WakelockPlus.disable();
}
return null;