1
0
mirror of https://github.com/immich-app/immich.git synced 2024-11-27 09:21:05 +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
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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;