Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions lib/pages/cashfusion/fusion_progress_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -84,6 +85,8 @@ class _FusionProgressViewState extends ConsumerState<FusionProgressView> {
message: "Stopping fusion",
);

await Wakelock.disable();

return true;
} else {
return false;
Expand All @@ -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 =
Expand All @@ -108,6 +117,8 @@ class _FusionProgressViewState extends ConsumerState<FusionProgressView> {
.watch(fusionProgressUIStateProvider(widget.walletId))
.fusionRoundsCompleted;

Wakelock.enable();

return WillPopScope(
onWillPop: () async {
return await _requestAndProcessCancel();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import 'dart:async';
import 'dart:io';

import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:wakelock/wakelock.dart';

import '../../../providers/cash_fusion/fusion_progress_ui_state_provider.dart';
import '../../../providers/global/prefs_provider.dart';
Expand Down Expand Up @@ -137,6 +139,8 @@ class _FusionDialogViewState extends ConsumerState<FusionDialogView> {
message: "Stopping fusion",
);

await Wakelock.disable();

return true;
} else {
return false;
Expand All @@ -150,6 +154,12 @@ class _FusionDialogViewState extends ConsumerState<FusionDialogView> {
super.initState();
}

@override
dispose() {
Wakelock.disable();
super.dispose();
}

@override
Widget build(BuildContext context) {
final bool _succeeded =
Expand All @@ -162,6 +172,10 @@ class _FusionDialogViewState extends ConsumerState<FusionDialogView> {
.watch(fusionProgressUIStateProvider(widget.walletId))
.fusionRoundsCompleted;

if (!Platform.isLinux) {
Wakelock.enable();
}

return DesktopDialog(
maxHeight: 600,
child: SingleChildScrollView(
Expand Down