mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-03-23 07:38:49 +00:00
Merge remote-tracking branch 'origin/arti' into fusion
This commit is contained in:
commit
57a5bdc1a7
1 changed files with 14 additions and 14 deletions
|
@ -43,7 +43,6 @@ import 'package:stackwallet/utilities/assets.dart';
|
||||||
import 'package:stackwallet/utilities/constants.dart';
|
import 'package:stackwallet/utilities/constants.dart';
|
||||||
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
||||||
import 'package:stackwallet/utilities/enums/exchange_rate_type_enum.dart';
|
import 'package:stackwallet/utilities/enums/exchange_rate_type_enum.dart';
|
||||||
import 'package:stackwallet/utilities/prefs.dart';
|
|
||||||
import 'package:stackwallet/utilities/text_styles.dart';
|
import 'package:stackwallet/utilities/text_styles.dart';
|
||||||
import 'package:stackwallet/utilities/util.dart';
|
import 'package:stackwallet/utilities/util.dart';
|
||||||
import 'package:stackwallet/widgets/conditional_parent.dart';
|
import 'package:stackwallet/widgets/conditional_parent.dart';
|
||||||
|
@ -80,11 +79,17 @@ class _ExchangeFormState extends ConsumerState<ExchangeForm> {
|
||||||
late final Coin? coin;
|
late final Coin? coin;
|
||||||
late final bool walletInitiated;
|
late final bool walletInitiated;
|
||||||
|
|
||||||
var exchanges = [
|
List<Exchange> get usableExchanges {
|
||||||
|
if (ref.read(prefsChangeNotifierProvider).useTor) {
|
||||||
|
return Exchange.exchangesWithTorSupport;
|
||||||
|
} else {
|
||||||
|
return [
|
||||||
MajesticBankExchange.instance,
|
MajesticBankExchange.instance,
|
||||||
ChangeNowExchange.instance,
|
ChangeNowExchange.instance,
|
||||||
TrocadorExchange.instance,
|
TrocadorExchange.instance,
|
||||||
];
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
late final TextEditingController _sendController;
|
late final TextEditingController _sendController;
|
||||||
late final TextEditingController _receiveController;
|
late final TextEditingController _receiveController;
|
||||||
|
@ -623,7 +628,7 @@ class _ExchangeFormState extends ConsumerState<ExchangeForm> {
|
||||||
final uuid = const Uuid().v1();
|
final uuid = const Uuid().v1();
|
||||||
_latestUuid = uuid;
|
_latestUuid = uuid;
|
||||||
_addUpdate(uuid);
|
_addUpdate(uuid);
|
||||||
for (final exchange in exchanges) {
|
for (final exchange in usableExchanges) {
|
||||||
ref.read(efEstimatesListProvider(exchange.name).notifier).state = null;
|
ref.read(efEstimatesListProvider(exchange.name).notifier).state = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -644,7 +649,7 @@ class _ExchangeFormState extends ConsumerState<ExchangeForm> {
|
||||||
final Map<String, Tuple2<ExchangeResponse<List<Estimate>>, Range?>>
|
final Map<String, Tuple2<ExchangeResponse<List<Estimate>>, Range?>>
|
||||||
results = {};
|
results = {};
|
||||||
|
|
||||||
for (final exchange in exchanges) {
|
for (final exchange in usableExchanges) {
|
||||||
final sendCurrency = pair.send?.forExchange(exchange.name);
|
final sendCurrency = pair.send?.forExchange(exchange.name);
|
||||||
final receiveCurrency = pair.receive?.forExchange(exchange.name);
|
final receiveCurrency = pair.receive?.forExchange(exchange.name);
|
||||||
|
|
||||||
|
@ -674,7 +679,7 @@ class _ExchangeFormState extends ConsumerState<ExchangeForm> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (final exchange in exchanges) {
|
for (final exchange in usableExchanges) {
|
||||||
if (uuid == _latestUuid) {
|
if (uuid == _latestUuid) {
|
||||||
ref.read(efEstimatesListProvider(exchange.name).notifier).state =
|
ref.read(efEstimatesListProvider(exchange.name).notifier).state =
|
||||||
results[exchange.name];
|
results[exchange.name];
|
||||||
|
@ -778,11 +783,6 @@ class _ExchangeFormState extends ConsumerState<ExchangeForm> {
|
||||||
// Instantiate the Tor service.
|
// Instantiate the Tor service.
|
||||||
torService = TorService.sharedInstance;
|
torService = TorService.sharedInstance;
|
||||||
|
|
||||||
// Filter exchanges based on Tor support.
|
|
||||||
if (Prefs.instance.useTor) {
|
|
||||||
exchanges = Exchange.exchangesWithTorSupport;
|
|
||||||
}
|
|
||||||
|
|
||||||
super.initState();
|
super.initState();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue