mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-03-08 17:54:26 +00:00
add running setter and set running to false on exception in fuse
This commit is contained in:
parent
3df33ceb17
commit
9d001c3fba
2 changed files with 190 additions and 173 deletions
|
@ -149,6 +149,10 @@ class FusionProgressUIState extends ChangeNotifier {
|
||||||
/// A flag indicating that fusion is running.
|
/// A flag indicating that fusion is running.
|
||||||
bool _running = false;
|
bool _running = false;
|
||||||
bool get running => _running;
|
bool get running => _running;
|
||||||
|
set running(bool running) {
|
||||||
|
_running = running;
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
|
||||||
/// A helper method for setting the running flag.
|
/// A helper method for setting the running flag.
|
||||||
///
|
///
|
||||||
|
|
|
@ -417,6 +417,7 @@ mixin FusionWalletInterface {
|
||||||
}) async {
|
}) async {
|
||||||
// Initial attempt for CashFusion integration goes here.
|
// Initial attempt for CashFusion integration goes here.
|
||||||
|
|
||||||
|
try {
|
||||||
_updateStatus(status: fusion.FusionStatus.reset);
|
_updateStatus(status: fusion.FusionStatus.reset);
|
||||||
_updateStatus(
|
_updateStatus(
|
||||||
status: fusion.FusionStatus.connecting,
|
status: fusion.FusionStatus.connecting,
|
||||||
|
@ -518,7 +519,8 @@ mixin FusionWalletInterface {
|
||||||
|
|
||||||
if (bitbox.Address.detectFormat(addressString) ==
|
if (bitbox.Address.detectFormat(addressString) ==
|
||||||
bitbox.Address.formatCashAddr) {
|
bitbox.Address.formatCashAddr) {
|
||||||
possibleAddresses.add(bitbox.Address.toLegacyAddress(addressString));
|
possibleAddresses
|
||||||
|
.add(bitbox.Address.toLegacyAddress(addressString));
|
||||||
} else {
|
} else {
|
||||||
possibleAddresses.add(bitbox.Address.toCashAddress(addressString));
|
possibleAddresses.add(bitbox.Address.toCashAddress(addressString));
|
||||||
}
|
}
|
||||||
|
@ -603,6 +605,17 @@ mixin FusionWalletInterface {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} catch (e, s) {
|
||||||
|
Logging.instance.log(
|
||||||
|
"$e\n$s",
|
||||||
|
level: LogLevel.Error,
|
||||||
|
);
|
||||||
|
|
||||||
|
// Stop the fusion process and update the UI state.
|
||||||
|
await _mainFusionObject?.stop();
|
||||||
|
_mainFusionObject = null;
|
||||||
|
_uiState?.running = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Stop the fusion process.
|
/// Stop the fusion process.
|
||||||
|
|
Loading…
Reference in a new issue