Merge branch 'main' into CW-285-Show-number-of-confirmations-in-transactions-screen-for-Monero-and-Haven-if-10

This commit is contained in:
Serhii
2023-02-10 00:06:57 +02:00
24 changed files with 1100 additions and 1020 deletions
@@ -239,7 +239,7 @@ abstract class DashboardViewModelBase with Store {
WalletBase<Balance, TransactionHistoryBase<TransactionInfo>, TransactionInfo>
wallet;
bool get hasRescan => wallet.type == WalletType.monero;
bool get hasRescan => wallet.type == WalletType.monero || wallet.type == WalletType.haven;
BalanceViewModel balanceViewModel;
@@ -192,7 +192,7 @@ abstract class ExchangeViewModelBase with Store {
ObservableList<ExchangeTemplate> get templates =>
_exchangeTemplateStore.templates;
@computed
TransactionPriority get transactionPriority {
final priority = _settingsStore.priority[wallet.type];
@@ -308,10 +308,11 @@ abstract class ExchangeViewModelBase with Store {
Future<void> _calculateBestRate() async {
final amount = double.tryParse(isFixedRateMode ? receiveAmount : depositAmount) ?? 1;
final _providers = _tradeAvailableProviders
.where((element) => !isFixedRateMode || element.supportsFixedRate).toList();
final result = await Future.wait<double>(
_tradeAvailableProviders
.where((element) => !isFixedRateMode || element.supportsFixedRate)
.map((element) => element.fetchRate(
_providers.map((element) => element.fetchRate(
from: depositCurrency,
to: receiveCurrency,
amount: amount,
@@ -324,7 +325,12 @@ abstract class ExchangeViewModelBase with Store {
for (int i=0;i<result.length;i++) {
if (result[i] != 0) {
/// add this provider as its valid for this trade
_sortedAvailableProviders[result[i]] = _tradeAvailableProviders[i];
try {
_sortedAvailableProviders[result[i]] = _providers[i];
} catch (e) {
// will throw "Concurrent modification during iteration" error if modified at the same
// time [createTrade] is called, as this is not a normal map, but a sorted map
}
}
}
if (_sortedAvailableProviders.isNotEmpty) {
+2 -2
View File
@@ -42,7 +42,7 @@ abstract class SupportViewModelBase with Store {
title: 'Telegram',
icon: 'assets/images/Telegram.png',
linkTitle: '@cakewallet_bot',
link: 'https:t.me/cakewallet_bot'),
link: 'https://t.me/cakewallet_bot'),
LinkListItem(
title: 'Twitter',
icon: 'assets/images/Twitter.png',
@@ -84,7 +84,7 @@ abstract class SupportViewModelBase with Store {
// link: 'mailto:support@y.at')
];
static const url = 'https://cakewallet.com/guide/';
static const url = 'https://guides.cakewallet.com';
List<SettingsListItem> items;
}