1
0
mirror of https://github.com/immich-app/immich.git synced 2025-08-10 23:22:22 +02:00

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

chore: only enable wakelock when backup is running
This commit is contained in:
Saschl
2024-08-16 15:08:21 +02:00
committed by GitHub
parent c582a841ba
commit 1c754b60dc

View File

@@ -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;