mirror of
https://github.com/samsonjs/immich.git
synced 2026-04-27 15:07:45 +00:00
chore: prevent going into sleep mode for large deletion (#25592)
This commit is contained in:
parent
4707821451
commit
97df9fd53f
1 changed files with 8 additions and 0 deletions
|
|
@ -13,6 +13,7 @@ import 'package:immich_mobile/providers/haptic_feedback.provider.dart';
|
||||||
import 'package:immich_mobile/providers/infrastructure/album.provider.dart';
|
import 'package:immich_mobile/providers/infrastructure/album.provider.dart';
|
||||||
import 'package:immich_mobile/routing/router.dart';
|
import 'package:immich_mobile/routing/router.dart';
|
||||||
import 'package:immich_mobile/utils/bytes_units.dart';
|
import 'package:immich_mobile/utils/bytes_units.dart';
|
||||||
|
import 'package:wakelock_plus/wakelock_plus.dart';
|
||||||
|
|
||||||
class FreeUpSpaceSettings extends ConsumerStatefulWidget {
|
class FreeUpSpaceSettings extends ConsumerStatefulWidget {
|
||||||
const FreeUpSpaceSettings({super.key});
|
const FreeUpSpaceSettings({super.key});
|
||||||
|
|
@ -29,6 +30,7 @@ class _FreeUpSpaceSettingsState extends ConsumerState<FreeUpSpaceSettings> {
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
|
WakelockPlus.enable();
|
||||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||||
_initializeAlbumDefaults();
|
_initializeAlbumDefaults();
|
||||||
});
|
});
|
||||||
|
|
@ -168,6 +170,12 @@ class _FreeUpSpaceSettingsState extends ConsumerState<FreeUpSpaceSettings> {
|
||||||
context.pushRoute(CleanupPreviewRoute(assets: assets));
|
context.pushRoute(CleanupPreviewRoute(assets: assets));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
dispose() {
|
||||||
|
super.dispose();
|
||||||
|
WakelockPlus.disable();
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final state = ref.watch(cleanupProvider);
|
final state = ref.watch(cleanupProvider);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue