Add new frontend - fix 7

This commit is contained in:
Urtzi Alfaro
2025-07-22 12:59:17 +02:00
parent 5230915bc2
commit d04359eca5
2 changed files with 3 additions and 3 deletions

View File

@@ -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

View File

@@ -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';
}
}