V4.6.4 bug fixes (#922)

* Fix Concurrent modification exception

* Fix minor UI issues

* Change onramper crypto asset name for Litcoin

* Fix secure storage issue, fetching password/PIN with null

* - Fix Navigation issue while keyboard is displaying
- Remove deprecated screen

* Take currency From/To info from our trade not the returned one

* Fix anon pay fields UI

* Fix Anonpay border/icons UI

* Add extra padding in QR image as a safe layer

* Generalize ignored connection error

* Remove Bio Auth option from desktop

* Fix some Transaction info not parsed correctly
This commit is contained in:
Omar Hatem
2023-05-10 16:58:31 +03:00
committed by GitHub
parent e28e2fbdde
commit 1a3d47748d
16 changed files with 113 additions and 157 deletions
@@ -123,8 +123,8 @@ abstract class ExchangeTradeViewModelBase with Store {
}
void _updateItems() {
final tagFrom = trade.from.tag != null ? '${trade.from.tag}' + ' ' : '';
final tagTo = trade.to.tag != null ? '${trade.to.tag}' + ' ' : '';
final tagFrom = tradesStore.trade!.from.tag != null ? '${tradesStore.trade!.from.tag}' + ' ' : '';
final tagTo = tradesStore.trade!.to.tag != null ? '${tradesStore.trade!.to.tag}' + ' ' : '';
items.clear();
items.add(ExchangeTradeItem(
title: "${trade.provider.title} ${S.current.id}", data: '${trade.id}', isCopied: true));
@@ -142,11 +142,11 @@ abstract class ExchangeTradeViewModelBase with Store {
items.addAll([
ExchangeTradeItem(title: S.current.amount, data: '${trade.amount}', isCopied: true),
ExchangeTradeItem(
title: S.current.send_to_this_address('${trade.from}', tagFrom) + ':',
title: S.current.send_to_this_address('${tradesStore.trade!.from}', tagFrom) + ':',
data: trade.inputAddress ?? '',
isCopied: true),
ExchangeTradeItem(
title: S.current.arrive_in_this_address('${trade.to}', tagTo) + ':',
title: S.current.arrive_in_this_address('${tradesStore.trade!.to}', tagTo) + ':',
data: trade.payoutAddress ?? '',
isCopied: true),
]);
@@ -3,7 +3,6 @@ import 'dart:collection';
import 'dart:convert';
import 'package:cake_wallet/entities/exchange_api_mode.dart';
import 'package:cake_wallet/entities/fiat_api_mode.dart';
import 'package:cake_wallet/entities/preferences_key.dart';
import 'package:cake_wallet/exchange/sideshift/sideshift_exchange_provider.dart';
import 'package:cake_wallet/exchange/sideshift/sideshift_request.dart';
@@ -244,7 +243,7 @@ abstract class ExchangeViewModelBase with Store {
List<CryptoCurrency> depositCurrencies;
NumberFormat _cryptoNumberFormat;
final NumberFormat _cryptoNumberFormat;
final SettingsStore _settingsStore;
@@ -388,27 +387,36 @@ abstract class ExchangeViewModelBase with Store {
double? lowestMin = double.maxFinite;
double? highestMax = 0.0;
for (var provider in selectedProviders) {
/// if this provider is not valid for the current pair, skip it
if (!providersForCurrentPair().contains(provider)) {
continue;
}
try {
final tempLimits = await provider.fetchLimits(
from: from,
to: to,
isFixedRateMode: isFixedRateMode);
if (lowestMin != null && (tempLimits.min ?? -1) < lowestMin) {
lowestMin = tempLimits.min;
try {
for (var provider in selectedProviders) {
/// if this provider is not valid for the current pair, skip it
if (!providersForCurrentPair().contains(provider)) {
continue;
}
if (highestMax != null && (tempLimits.max ?? double.maxFinite) > highestMax) {
highestMax = tempLimits.max;
try {
final tempLimits = await provider.fetchLimits(
from: from,
to: to,
isFixedRateMode: isFixedRateMode);
if (lowestMin != null && (tempLimits.min ?? -1) < lowestMin) {
lowestMin = tempLimits.min;
}
if (highestMax != null && (tempLimits.max ?? double.maxFinite) > highestMax) {
highestMax = tempLimits.max;
}
} catch (e) {
continue;
}
} catch (e) {
continue;
}
} on ConcurrentModificationError {
/// if user changed the selected providers while fetching limits
/// then delay the fetching limits a bit and try again
///
/// this is because the limitation of collections that
/// you can't modify it while iterating through it
Future.delayed(Duration(milliseconds: 200), loadLimits);
}
if (lowestMin != double.maxFinite) {
@@ -534,7 +542,7 @@ abstract class ExchangeViewModelBase with Store {
///
/// this is because the limitation of the SplayTreeMap that
/// you can't modify it while iterating through it
Future.delayed(Duration(milliseconds: 500), createTrade);
Future.delayed(Duration(milliseconds: 200), createTrade);
}
}