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.
This commit is contained in:
padreug 2025-09-18 22:25:43 +02:00
parent a9c07f6af3
commit 58b785724e

View file

@ -86,8 +86,14 @@ function closeScanner() {
} }
function handleScanResult(result: string) { function handleScanResult(result: string) {
// Set the scanned result in the destination field // Clean up the scanned result by removing lightning: prefix if present
setFieldValue('destination', result) 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() closeScanner()
toastService?.success('QR code scanned successfully!') toastService?.success('QR code scanned successfully!')
} }