fix: Handle ethereum QR for pay anything (#3250)

This commit is contained in:
David Adegoke
2026-05-21 17:38:17 +02:00
committed by GitHub
parent d40e4c6923
commit 087c2b9411
@@ -78,7 +78,7 @@ class _TokenSelectionContentState extends State<_TokenSelectionContent> {
void initState() {
super.initState();
final baseNetwork = widget.fixedNetwork ?? WalletType.ethereum;
selectedNetwork = _resolveGenericETHDetectionResultToSpecificChain(baseNetwork);
selectedNetwork = _resolveGenericETHDetectionResultToSpecificChain(baseNetwork, widget.paymentRequest.scheme.isNotEmpty);
_autoSelectToken();
}
@@ -101,8 +101,9 @@ class _TokenSelectionContentState extends State<_TokenSelectionContent> {
return null;
}
WalletType _resolveGenericETHDetectionResultToSpecificChain(WalletType network) {
if (network != WalletType.ethereum) return network;
WalletType _resolveGenericETHDetectionResultToSpecificChain(WalletType network, bool hasURIScheme) {
if(hasURIScheme || network != WalletType.ethereum) return network;
final current = widget.paymentViewModel.currentWalletType;
if (isEVMCompatibleChain(current)) return current;
return network;
@@ -112,7 +113,7 @@ class _TokenSelectionContentState extends State<_TokenSelectionContent> {
final initialNetwork = selectedNetwork;
if (initialNetwork == null || !mounted) return;
final network = _resolveGenericETHDetectionResultToSpecificChain(initialNetwork);
final network = _resolveGenericETHDetectionResultToSpecificChain(initialNetwork, widget.paymentRequest.scheme.isNotEmpty);
setState(() {
selectedNetwork = network;