Skip to content

Commit 929eb8f

Browse files
committed
chore: Use wss in production
1 parent 3fe15ce commit 929eb8f

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/components/molecules/TemplateRenderer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ function BaseTemplateRenderer({ templateCode, template }: { templateCode: string
8383
// TODO: Store in localStorage
8484
}
8585
});
86-
}, [getCurrentCode, template]);
86+
}, [getCurrentCode, template, startTime]);
8787

8888
return (
8989
<div className="flex gap-24 w-full justify-around m-12 max-w-full">

src/pages/Logs.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ export function Logs(): ReactElement {
5656
const [logs, setLogs] = useState<Log[]>([]);
5757

5858
if (!socketRef.current) {
59-
const socket = new WebSocket(`ws://${window.location.hostname}:${window.location.port}/socket`);
59+
const socket = new WebSocket(
60+
`${process.env.NODE_ENV === 'production' ? 'wss' : 'ws'}://${window.location.hostname}:${window.location.port}/socket`
61+
);
6062
socket.addEventListener('open', () => console.log('Socket connected'));
6163
socket.addEventListener('message', (message: MessageEvent) => {
6264
const newLogs = JSON.parse(message.data).map(

0 commit comments

Comments
 (0)