From e7f909678bb8ec5742f62996d5113cc867324e2f Mon Sep 17 00:00:00 2001 From: iDefineHD Date: Sun, 11 Jan 2026 02:38:10 +0000 Subject: [PATCH] Remove debug logs from WebSocket store - Removed verbose console.log statements - Kept essential error warning for config fetch failures - Cleaner production console output --- frontend/src/stores/websocket.js | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/frontend/src/stores/websocket.js b/frontend/src/stores/websocket.js index 39ff82c..d63e025 100644 --- a/frontend/src/stores/websocket.js +++ b/frontend/src/stores/websocket.js @@ -31,47 +31,27 @@ export const useWebSocketStore = defineStore("websocket", () => { // Helper functions const getWebSocketUrl = async () => { - console.log("[WebSocket] Getting WebSocket URL..."); - // Use environment variable or fallback if (import.meta.env.VITE_WS_URL) { - console.log( - "[WebSocket] Using VITE_WS_URL:", - import.meta.env.VITE_WS_URL - ); return import.meta.env.VITE_WS_URL; } // Try to fetch from backend config API try { const apiUrl = import.meta.env.VITE_API_URL || "http://localhost:3000"; - console.log( - "[WebSocket] Fetching config from:", - `${apiUrl}/api/config/public` - ); const response = await fetch(`${apiUrl}/api/config/public`); const data = await response.json(); if (data.success && data.config.websocket?.url) { - console.log( - "[WebSocket] Got URL from backend:", - data.config.websocket.url - ); return data.config.websocket.url; } - console.warn("[WebSocket] Backend config missing websocket URL"); } catch (error) { - console.warn( - "[WebSocket] Failed to fetch WebSocket URL from config:", - error - ); + console.warn("Failed to fetch WebSocket URL from config:", error); } // Fallback: use API domain with /ws path const apiUrl = import.meta.env.VITE_API_URL || "https://api.turbotrades.dev"; - const fallbackUrl = apiUrl.replace(/^http/, "ws") + "/ws"; - console.log("[WebSocket] Using fallback URL:", fallbackUrl); - return fallbackUrl; + return apiUrl.replace(/^http/, "ws") + "/ws"; }; const clearHeartbeat = () => {