From 58b785724e93b42de4f739971eef226218b97b1b Mon Sep 17 00:00:00 2001 From: padreug Date: Thu, 18 Sep 2025 22:25:43 +0200 Subject: [PATCH] Refactor QR code scanning result handling in SendDialog.vue - Cleaned up the scanned result by removing the "lightning:" prefix if present before setting it in the destination field. - Improved user feedback by ensuring only the cleaned result is processed, enhancing the overall scanning functionality. These changes enhance the accuracy of QR code scanning results for payment destinations. --- src/modules/wallet/components/SendDialog.vue | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/modules/wallet/components/SendDialog.vue b/src/modules/wallet/components/SendDialog.vue index ea74808..c7dc4f1 100644 --- a/src/modules/wallet/components/SendDialog.vue +++ b/src/modules/wallet/components/SendDialog.vue @@ -86,8 +86,14 @@ function closeScanner() { } function handleScanResult(result: string) { - // Set the scanned result in the destination field - setFieldValue('destination', result) + // Clean up the scanned result by removing lightning: prefix if present + let cleanedResult = result + if (result.toLowerCase().startsWith('lightning:')) { + cleanedResult = result.substring(10) // Remove "lightning:" prefix + } + + // Set the cleaned result in the destination field + setFieldValue('destination', cleanedResult) closeScanner() toastService?.success('QR code scanned successfully!') }