fix: port value

This commit is contained in:
Vlad Stan 2023-03-17 17:24:33 +02:00
parent 28c0947afb
commit f7fb926c52

View file

@ -263,7 +263,8 @@
waitForPaidInvoice: function (paymentHash) {
try {
const scheme = location.protocol === 'http:' ? 'ws' : 'wss'
const wsUrl = `${scheme}://${document.domain}:${location.port}/api/v1/ws/${paymentHash}`
const port = location.port ? `:${location.port}` : ''
const wsUrl = `${scheme}://${document.domain}${port}/api/v1/ws/${paymentHash}`
const wsConnection = new WebSocket(wsUrl)
wsConnection.onmessage = e => {
this.invoiceResponse = JSON.parse(e.data)