refactor maxConsecutiveFusionRoundsFailed->failed

This commit is contained in:
sneurlax 2023-10-19 12:52:21 -05:00
parent 4a619d68ad
commit d5c4923031
2 changed files with 10 additions and 7 deletions

View file

@ -109,7 +109,7 @@ class FusionProgressUIState extends ChangeNotifier {
void incrementFusionRoundsCompleted() {
_fusionRoundsCompleted++;
_fusionRoundsFailed = 0; // Reset failed round count on success.
_maxConsecutiveFusionRoundsFailed = false; // Reset failed flag on success.
_failed = false; // Reset failed flag on success.
notifyListeners();
}
@ -129,11 +129,14 @@ class FusionProgressUIState extends ChangeNotifier {
/// A flag indicating that fusion has stopped because the maximum number of
/// consecutive failed fusion rounds has been reached.
bool _maxConsecutiveFusionRoundsFailed = false;
bool get maxConsecutiveFusionRoundsFailed =>
_maxConsecutiveFusionRoundsFailed;
set maxConsecutiveFusionRoundsFailed(bool maxConsecutiveFusionRoundsFailed) {
_maxConsecutiveFusionRoundsFailed = maxConsecutiveFusionRoundsFailed;
///
/// Set from the interface. I didn't want to have to configure
///
/// Used to be named maxConsecutiveFusionRoundsFailed.
bool _failed = true;
bool get failed => _failed;
set failed(bool failed) {
_failed = failed;
notifyListeners();
}
}

View file

@ -572,7 +572,7 @@ mixin FusionWalletInterface {
// If we fail too many times in a row, stop trying.
if (_failedFuseCount >= maxFailedFuseCount) {
_stopRequested = true;
_uiState?.maxConsecutiveFusionRoundsFailed = true;
_uiState?.failed = true;
}
} finally {
// Increment the number of successfully completed fusion rounds.