Also check protocol name before setting address field (#2562)

* Also check protocol name before setting address field

* Add comment why we remove the domain part if lud16Domain is set

---------

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
This commit is contained in:
ekzyis 2025-09-22 00:46:27 +02:00 committed by GitHub
parent a544e3952d
commit 4676fbaf60
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -98,7 +98,7 @@ export function useProtocolForm (protocol) {
value = complementaryFormState?.config?.[field.name]
}
if (protocol.name === 'LN_ADDR' && field.name === 'address') {
if (protocol.name === 'LN_ADDR' && field.name === 'address' && lud16Domain && value) {
// automatically set lightning addresses from NWC urls if lud16 parameter is present
if (nwcSendFormState?.config?.url) {
const { lud16 } = parseNwcUrl(nwcSendFormState.config.url)