stop fusion on cashfusion view disposal

WIP
This commit is contained in:
sneurlax 2023-10-17 22:23:27 -05:00
parent ed2a637e5e
commit 9d4cdb31bd
2 changed files with 12 additions and 1 deletions

@ -1 +1 @@
Subproject commit 1f98575c58d5b3144ac6e5e613311307c22e53b2
Subproject commit 0b6c2f931932dbd07e6aacc2826b0ceb5332ba99

View file

@ -85,6 +85,17 @@ class _CashFusionViewState extends ConsumerState<CashFusionView> {
@override
void dispose() {
// Stop the fusion process on dispose.
//
// Hack to stop fusion when a mobile user clicks back.
final fusionWallet = ref
.read(walletsChangeNotifierProvider)
.getManager(widget.walletId)
.wallet as FusionWalletInterface;
// We probably want to await this and showLoading while it stops.
unawaited(fusionWallet.stop());
serverController.dispose();
portController.dispose();
fusionRoundController.dispose();