feat: add optional domain field (#120)

* feat: add optional domain field
closes #119
This commit is contained in:
dni ⚡ 2026-01-15 09:20:54 +01:00 committed by GitHub
commit 17135b45ae
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 107 additions and 46 deletions

View file

@ -2,10 +2,26 @@ window.PageLnurlpPublic = {
template: '#page-lnurlp-public',
data() {
return {
url: ''
url: '',
payLink: null
}
},
methods: {
setUrl(link_id, domain) {
this.url = `https://${domain || window.location.host}/lnurlp/${link_id}`
},
getPayLink() {
this.api
.request('GET', `/lnurlp/api/v1/links/public/${this.$route.params.id}`)
.then(res => {
this.payLink = res.data
this.setUrl(this.payLink.id, this.payLink.domain)
})
.catch(this.utils.notifyApiError)
}
},
created() {
this.url = window.location.origin + '/lnurlp/' + this.$route.params.id
this.setUrl(this.$route.params.id)
this.getPayLink()
}
}