couple tweaks

This commit is contained in:
julian 2023-10-24 16:43:41 -06:00
parent 453316feb4
commit 3c4fc5e0cc
2 changed files with 3 additions and 22 deletions

View file

@ -148,9 +148,7 @@ class _CashFusionViewState extends ConsumerState<CashFusionView> {
Theme.of(context).extension<StackColors>()!.background,
appBar: AppBar(
automaticallyImplyLeading: false,
leading: AppBarBackButton(onPressed: () {
_stop();
}),
leading: const AppBarBackButton(),
title: Text(
"CashFusion",
style: STextStyles.navBarTitle(context),
@ -445,21 +443,4 @@ class _CashFusionViewState extends ConsumerState<CashFusionView> {
),
);
}
/// Stops the fusion process.
///
/// This is called when the user presses the back button.
void _stop() async {
final fusionWallet = ref
.read(walletsChangeNotifierProvider)
.getManager(widget.walletId)
.wallet as FusionWalletInterface;
await fusionWallet.stop();
// TODO await successful cancellation and showLoading while it stops.
if (mounted) {
Navigator.of(context).pop();
}
}
}

View file

@ -184,7 +184,7 @@ class _FusionProgressViewState extends ConsumerState<FusionProgressView> {
if (_succeeded)
PrimaryButton(
label: "Fuse again",
onPressed: () => _fuseAgain,
onPressed: _fuseAgain,
),
if (_succeeded)
const SizedBox(
@ -193,7 +193,7 @@ class _FusionProgressViewState extends ConsumerState<FusionProgressView> {
if (_failed)
PrimaryButton(
label: "Try again",
onPressed: () => _fuseAgain,
onPressed: _fuseAgain,
),
if (_failed)
const SizedBox(