mirror of
https://github.com/owntone/owntone-server.git
synced 2025-11-26 04:26:14 -05:00
[web] Change to template literals
This commit is contained in:
@@ -151,21 +151,17 @@ export default {
|
||||
protocol = 'wss://'
|
||||
}
|
||||
|
||||
let wsUrl =
|
||||
protocol +
|
||||
window.location.hostname +
|
||||
':' +
|
||||
let wsUrl = `${protocol + window.location.hostname}:${
|
||||
vm.$store.state.config.websocket_port
|
||||
}`
|
||||
|
||||
if (import.meta.env.DEV && import.meta.env.VITE_OWNTONE_URL) {
|
||||
// If we are running in development mode, construct the websocket url
|
||||
// from the host of the environment variable VITE_OWNTONE_URL
|
||||
const owntoneUrl = new URL(import.meta.env.VITE_OWNTONE_URL)
|
||||
wsUrl =
|
||||
protocol +
|
||||
owntoneUrl.hostname +
|
||||
':' +
|
||||
wsUrl = `${protocol + owntoneUrl.hostname}:${
|
||||
vm.$store.state.config.websocket_port
|
||||
}`
|
||||
}
|
||||
|
||||
const socket = new ReconnectingWebSocket(wsUrl, 'notify', {
|
||||
|
||||
Reference in New Issue
Block a user