-
Notifications
You must be signed in to change notification settings - Fork 250
fix(dex): crash on buy coin dropdown selection #2624
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -293,6 +293,11 @@ class TakerBloc extends Bloc<TakerEvent, TakerState> { | |
| ), | ||
| ); | ||
|
|
||
| /// Unsupported coins like ARRR cause downstream errors, so we need to | ||
| /// remove them from the list here | ||
| bestOrders.result | ||
| ?.removeWhere((coinId, _) => excludedAssetList.contains(coinId)); | ||
|
|
||
|
Comment on lines
+296
to
+300
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Critical bugfix: Filter out unsupported coins to prevent crashes. This change applies the same fix as in BridgeBloc to filter out unsupported coins from the best orders list, ensuring consistency between the two implementations and preventing crashes during coin selection. The implementation correctly uses |
||
| emit(state.copyWith(bestOrders: () => bestOrders)); | ||
|
|
||
| final buyCoin = event.autoSelectOrderAbbr; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Critical bugfix: Filter out unsupported coins to prevent crashes.
This change prevents downstream errors by filtering out coins like 'ARRR' that lack proper activation parameters, addressing the crash mentioned in the PR title.
The implementation correctly uses
removeWhereto filter out all coins listed in theexcludedAssetListbefore updating the state with the best orders.