mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-26 06:08:40 +01:00
fix: Handle ethereum QR for pay anything (#3250)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user