use window location for ws in prod

This commit is contained in:
Andras Bacsai 2022-10-28 14:29:21 +00:00
parent c123669828
commit c8282b215d

View File

@ -172,7 +172,7 @@ export const state = writable<State>({
export const connect = () => {
const token = Cookies.get('token')
if (token) {
let url = "ws://localhost:3000/realtime"
let url = `ws://${window.location.hostname}/realtime`
if (dev) {
url = "ws://localhost:3001/realtime"
}