Skip to content

Commit

Permalink
frontend: fix tabs/spaces mismatch
Browse files Browse the repository at this point in the history
  • Loading branch information
roobre committed Jul 14, 2023
1 parent 3846126 commit 0ce61ad
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pkg/web/src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@
const json = await res.json();
quote = json.quotes[Math.floor(Math.random() * json.quotes.length)];
let wsUrl = `${PUBLIC_BACKEND_WS_ENDPOINT}`;
if (wsUrl === "") {
// Unlike with fetch, which understands "/" as "the current page", for WS we need to build the URI by hand.
const l = window.location;
wsUrl = ((l.protocol === "https:") ? "wss://" : "ws://") + l.hostname + (((l.port != 80) && (l.port != 443)) ? ":" + l.port : "") + "/ws";
}
let wsUrl = `${PUBLIC_BACKEND_WS_ENDPOINT}`;
if (wsUrl === "") {
// Unlike with fetch, which understands "/" as "the current page", for WS we need to build the URI by hand.
const l = window.location;
wsUrl = ((l.protocol === "https:") ? "wss://" : "ws://") + l.hostname + (((l.port != 80) && (l.port != 443)) ? ":" + l.port : "") + "/ws";
}
socket = new WebSocket(wsUrl);
socket.addEventListener('message', function (event) {
const data = JSON.parse(event.data);
Expand Down

0 comments on commit 0ce61ad

Please sign in to comment.