Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions apps/frontend/src/state/epics/wsEpics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,19 @@

let socket$: WebSocketSubject<PayloadAction> | null = null

const isElectron = window.location.protocol === "file:"
const isHttps = window.location.protocol === "https:"
const getWebsocketURL = () => {
const isElectron = window.location.protocol === "file:"
if (isElectron) {
return "ws://localhost:8080"
}

return (window.location.origin + window.location.pathname)
.replace(/^http/, 'ws')

Check failure on line 36 in apps/frontend/src/state/epics/wsEpics.ts

View workflow job for this annotation

GitHub Actions / lint

Strings must use doublequote
}
Comment thread
tkesgar marked this conversation as resolved.

const url =
import.meta.env.VITE_VALKEY_ADMIN_WS_URL ||
(isElectron
? "ws://localhost:8080"
: `${isHttps ? "wss" : "ws"}://${window.location.host}`)
getWebsocketURL()

const connect = (store: Store) =>
action$.pipe(
Expand Down
Loading