use wakelock on fusion progress view / dialog

revert desktop changes
This commit is contained in:
sneurlax 2024-07-03 17:54:51 -05:00 committed by julian-CStack
parent e8a2a5081b
commit ba8215a3d3

View file

@ -12,6 +12,7 @@ import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:wakelock/wakelock.dart';
import '../../pages_desktop_specific/cashfusion/sub_widgets/fusion_progress.dart';
import '../../providers/cash_fusion/fusion_progress_ui_state_provider.dart';
@ -84,6 +85,8 @@ class _FusionProgressViewState extends ConsumerState<FusionProgressView> {
message: "Stopping fusion",
);
await Wakelock.disable();
return true;
} else {
return false;
@ -96,6 +99,12 @@ class _FusionProgressViewState extends ConsumerState<FusionProgressView> {
super.initState();
}
@override
void dispose() {
Wakelock.disable();
super.dispose();
}
@override
Widget build(BuildContext context) {
final bool _succeeded =
@ -108,6 +117,8 @@ class _FusionProgressViewState extends ConsumerState<FusionProgressView> {
.watch(fusionProgressUIStateProvider(widget.walletId))
.fusionRoundsCompleted;
Wakelock.enable();
return WillPopScope(
onWillPop: () async {
return await _requestAndProcessCancel();