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:
parent
c582a841ba
commit
1c754b60dc
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user