fix onramper network tag plus UI (#1832)

Serhii committed Nov 27, 2024 at 19:06 UTC 125c40b49af4c9eeffe6dd462445bddb185a38e5
3 files changed +12 -3
lib/buy/onramper/onramper_buy_provider.dart
+3
@@ -248,9 +248,12 @@ class OnRamperBuyProvider extends BuyProvider {
248 String _tagToNetwork(String tag) {
249 switch (tag) {
250 case 'OMNI':
251 + case 'BSC':
252 return tag;
253 case 'POL':
254 return 'POLYGON';
255 + case 'ZEC':
256 + return 'ZCASH';
257 default:
258 try {
259 return CryptoCurrency.fromString(tag).fullName!;
lib/src/screens/buy/buy_sell_page.dart
+3 -2
@@ -170,8 +170,9 @@ class BuySellPage extends BasePage {
170 },
171 color: Theme.of(context).primaryColor,
172 textColor: Colors.white,
173 - isDisabled: false,
174 - isLoading: !buySellViewModel.isReadyToTrade)),
173 + isDisabled: buySellViewModel.isBuySellQuotFailed,
174 + isLoading: !buySellViewModel.isReadyToTrade &&
175 + !buySellViewModel.isBuySellQuotFailed)),
176 ]),
177 )),
178 ));
lib/view_model/buy/buy_sell_view_model.dart
+6 -1
@@ -155,13 +155,18 @@ abstract class BuySellViewModelBase extends WalletChangeListenerViewModel with S
155 final hasSelectedPaymentMethod = selectedPaymentMethod != null;
156 final isPaymentMethodLoaded = paymentMethodState is PaymentMethodLoaded;
157 final isBuySellQuotLoaded = buySellQuotState is BuySellQuotLoaded;
158 + final isBuySellQuotFailed = buySellQuotState is BuySellQuotFailed;
159
160 return hasSelectedQuote &&
161 hasSelectedPaymentMethod &&
162 isPaymentMethodLoaded &&
162 - isBuySellQuotLoaded;
163 + isBuySellQuotLoaded &&
164 + !isBuySellQuotFailed;
165 }
166
167 + @computed
168 + bool get isBuySellQuotFailed => buySellQuotState is BuySellQuotFailed;
169 +
170 @action
171 void reset() {
172 cryptoCurrency = wallet.currency;