diff --git a/lnbits/templates/base.html b/lnbits/templates/base.html
index 709df53d..b0915fd8 100644
--- a/lnbits/templates/base.html
+++ b/lnbits/templates/base.html
@@ -357,7 +357,7 @@
})
const websocketPrefix =
window.location.protocol === 'http:' ? 'ws://' : 'wss://'
- const websocketUrl = `${'http:' ? 'ws://' : 'wss://'}${window.location.host}/api/v1/ws`
+ const websocketUrl = `${websocketPrefix}${window.location.host}/api/v1/ws`
{% block scripts %}{% endblock %} {% for url in INCLUDED_COMPONENTS %}