6.1.0 fixes (#3190)

* - Fix swap state not maintained (fixed rate can be on or off at the same time)
- Fix Pay Anything putting contract address
- Pick the token of the URI

* fix incorrect function calls [skip ci]
This commit is contained in:
Omar Hatem
2026-04-18 00:05:14 +02:00
committed by GitHub
parent 2544e0cd58
commit 314eb36dd5
8 changed files with 49 additions and 14 deletions
@@ -100,7 +100,7 @@ class ConnectionSyncPage extends BasePage {
label: S.of(context).arbiscan_history,
value: _connectionSyncViewModel.useArbiScan,
onChanged: (val) {
_connectionSyncViewModel.setUsePolygonScan(val);
_connectionSyncViewModel.setUseArbiScan(val);
}),
if (_connectionSyncViewModel.canUseBscScan)
ListItemToggle(
@@ -116,7 +116,7 @@ class ConnectionSyncPage extends BasePage {
label: S.of(context).trongrid_history,
value: _connectionSyncViewModel.useTronGrid,
onChanged: (val) {
_connectionSyncViewModel.setUsePolygonScan(val);
_connectionSyncViewModel.setUseTronGrid(val);
}),
if (_connectionSyncViewModel.canUseMempoolFeeAPI)
ListItemToggle(
@@ -15,6 +15,9 @@ import 'package:cake_wallet/wallet_types.g.dart';
import 'package:cw_core/crypto_currency.dart';
import 'package:cw_core/currency.dart';
import 'package:cw_core/currency_for_wallet_type.dart';
import 'package:cw_core/erc20_token.dart';
import 'package:cw_core/spl_token.dart';
import 'package:cw_core/tron_token.dart';
import 'package:cw_core/utils/print_verbose.dart';
import 'package:cw_core/wallet_type.dart';
import 'package:flutter/material.dart';
@@ -78,7 +81,8 @@ class _TokenSelectionContentState extends State<_TokenSelectionContent> {
_autoSelectToken();
}
bool get _isNetworkSelectable => widget.fixedNetwork == null || isEVMCompatibleChain(widget.fixedNetwork!);
bool get _isNetworkSelectable =>
widget.fixedNetwork == null || isEVMCompatibleChain(widget.fixedNetwork!);
Future<void> _autoSelectToken() async {
if (selectedNetwork == null) return;
@@ -102,7 +106,11 @@ class _TokenSelectionContentState extends State<_TokenSelectionContent> {
}
setState(() {
selectedToken = tokens.first;
selectedToken = tokens.firstWhere((e) {
return (e is Erc20Token && e.contractAddress == widget.paymentRequest.contractAddress) ||
(e is SPLToken && e.mintAddress == widget.paymentRequest.contractAddress) ||
(e is TronToken && e.contractAddress == widget.paymentRequest.contractAddress);
}, orElse: () => tokens.first);
isLoadingTokens = false;
});
} catch (e) {