mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-17 05:41:29 +02:00
fix: block wrongly parsed addresses (#2656)
* fix: block wrongly parsed addresses * fix: move parsed address check into handlePaymentFlow method * fix: Handle QR URLs separately for pay anything flow
This commit is contained in:
@@ -149,6 +149,8 @@ class SendCardState extends State<SendCard> with AutomaticKeepAliveClientMixin<S
|
||||
}
|
||||
|
||||
Future<void> _handlePaymentFlow(String uri, PaymentRequest paymentRequest) async {
|
||||
if (uri.contains('@') || paymentRequest.address.contains('@')) return;
|
||||
|
||||
try {
|
||||
final result = await paymentViewModel.processAddress(uri);
|
||||
|
||||
@@ -446,8 +448,6 @@ class SendCardState extends State<SendCard> with AutomaticKeepAliveClientMixin<S
|
||||
final address =
|
||||
output.isParsedAddress ? output.extractedAddress : output.address;
|
||||
|
||||
if (address.contains('@')) return;
|
||||
|
||||
await _handlePaymentFlow(
|
||||
address,
|
||||
PaymentRequest(
|
||||
|
||||
@@ -45,7 +45,7 @@ abstract class PaymentViewModelBase with Store {
|
||||
return PaymentFlowResult.incompatible('Unable to detect address type');
|
||||
}
|
||||
|
||||
if (_isEVMAddress(detectionResult.address)) {
|
||||
if (!addressData.contains(':') && _isEVMAddress(detectionResult.address)) {
|
||||
return PaymentFlowResult.evmNetworkSelection(detectionResult);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user