From 8dbd87ff4c47d79a8506faa682bf458d10f54781 Mon Sep 17 00:00:00 2001 From: Tom Butcher Date: Sat, 19 Jul 2025 21:35:20 +0100 Subject: [PATCH] Remove debug logging statements from ApiServerContext and AuthContext to clean up the code and improve performance. --- src/components/Dashboard/context/ApiServerContext.js | 9 --------- src/components/Dashboard/context/AuthContext.js | 2 -- 2 files changed, 11 deletions(-) diff --git a/src/components/Dashboard/context/ApiServerContext.js b/src/components/Dashboard/context/ApiServerContext.js index 8eadaf7..ec145fc 100644 --- a/src/components/Dashboard/context/ApiServerContext.js +++ b/src/components/Dashboard/context/ApiServerContext.js @@ -244,8 +244,6 @@ const ApiServerProvider = ({ children }) => { subscribedCallbacksRef.current.set(id, callbacks) } } - - logger.debug('Removed update event listener for object:', id) } }, []) @@ -263,26 +261,19 @@ const ApiServerProvider = ({ children }) => { subscribedCallbacksRef.current.set(type, callbacks) } } - - logger.debug('Removed new event listener for type:', type) } }, []) const subscribeToObject = useCallback( (id, type, callback) => { - logger.debug('Subscribing to object:', id, 'type:', type) if (socketRef.current && socketRef.current.connected == true) { // Add callback to the subscribed callbacks map immediately if (!subscribedCallbacksRef.current.has(id)) { subscribedCallbacksRef.current.set(id, []) } subscribedCallbacksRef.current.get(id).push(callback) - logger.debug( - `Added callback for object ${id}, total callbacks: ${subscribedCallbacksRef.current.get(id).length}` - ) socketRef.current.emit('subscribe', { id: id, type: type }) - logger.debug('Registered update event listener for object:', id) // Return cleanup function return () => offUpdateEvent(id, type, callback) diff --git a/src/components/Dashboard/context/AuthContext.js b/src/components/Dashboard/context/AuthContext.js index f313b87..42d828c 100644 --- a/src/components/Dashboard/context/AuthContext.js +++ b/src/components/Dashboard/context/AuthContext.js @@ -170,8 +170,6 @@ const AuthProvider = ({ children }) => { } intervalId = setInterval(tokenRefresh, 1000) - - console.log('fresh', authenticated) tokenRefresh() return () => {