Skip to content

Commit

Permalink
Reset unused to null if there's a swap in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
erdemyerebasmaz committed Mar 27, 2024
1 parent e36724f commit 5a14864
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/bloc/swap_in_progress/swap_in_progress_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ class SwapInProgressBloc extends Cubit<SwapInProgressState> {
_log.info("Refreshing swap in address.");
_emitState(state.copyWith(isLoading: true));
SwapInfo? inProgress = (await _breezSDK.inProgressSwap());
_emitState(state.copyWith(inProgress: inProgress));
// Reset unused if there's a swap in progress
_emitState(state.copyWith(inProgress: inProgress, unused: inProgress != null ? null : state.unused));
if (state.inProgress == null && state.unused == null) {
_emitState(
state.copyWith(
Expand Down

0 comments on commit 5a14864

Please sign in to comment.