From d04359eca57e60d3e12a9197c966ba57b536660c Mon Sep 17 00:00:00 2001 From: Urtzi Alfaro Date: Tue, 22 Jul 2025 12:59:17 +0200 Subject: [PATCH] Add new frontend - fix 7 --- frontend/src/api/hooks/useSessionTimeout.ts | 2 +- frontend/src/api/websocket/WebSocketManager.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/api/hooks/useSessionTimeout.ts b/frontend/src/api/hooks/useSessionTimeout.ts index 967dcf78..e2eff53d 100644 --- a/frontend/src/api/hooks/useSessionTimeout.ts +++ b/frontend/src/api/hooks/useSessionTimeout.ts @@ -1,6 +1,6 @@ // src/hooks/useSessionTimeout.ts import { useEffect, useRef } from 'react'; -import { useAuth } from '../contexts/AuthContext'; +import { useAuth } from '../../contexts/AuthContext'; interface SessionTimeoutOptions { timeout: number; // milliseconds diff --git a/frontend/src/api/websocket/WebSocketManager.ts b/frontend/src/api/websocket/WebSocketManager.ts index 06cf8c6e..58ce8af2 100644 --- a/frontend/src/api/websocket/WebSocketManager.ts +++ b/frontend/src/api/websocket/WebSocketManager.ts @@ -216,13 +216,13 @@ class WebSocketManager extends EventEmitter { private getWebSocketBaseUrl(): string { if (typeof window !== 'undefined') { // Check if window is defined const protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:'; - const host = process.env.REACT_APP_WS_URL || window.location.host; + const host = process.env.FRONTEND_WS_URL || window.location.host; return `${protocol}//${host}/ws`; } else { // Provide a fallback for server-side or non-browser environments // You might want to get this from environment variables or a config file // depending on your setup. - return process.env.REACT_APP_WS_URL || 'ws://localhost:3000/ws'; + return process.env.FRONTEND_WS_URL || 'ws://localhost:3000/ws'; } }