From 4995d37aa2ac6ce5b065776fb35ab978d46c21ee Mon Sep 17 00:00:00 2001 From: Tom Butcher Date: Sun, 7 Dec 2025 02:38:39 +0000 Subject: [PATCH] Removed console.log statements from various components to clean up the code and improve performance. --- src/components/Dashboard/common/FileUpload.jsx | 1 - src/components/Dashboard/common/ObjectChildTable.jsx | 1 - src/components/Dashboard/common/PrinterMiscPanel.jsx | 2 -- .../Dashboard/common/PrinterPositionPanel.jsx | 2 -- .../Dashboard/common/PrinterTemperaturePanel.jsx | 4 +--- .../Dashboard/context/ActionsModalContext.jsx | 3 --- src/components/Dashboard/context/ApiServerContext.jsx | 10 +--------- 7 files changed, 2 insertions(+), 21 deletions(-) diff --git a/src/components/Dashboard/common/FileUpload.jsx b/src/components/Dashboard/common/FileUpload.jsx index d5b3ef5..5f3687e 100644 --- a/src/components/Dashboard/common/FileUpload.jsx +++ b/src/components/Dashboard/common/FileUpload.jsx @@ -54,7 +54,6 @@ const FileUpload = ({ currentFiles.length === 0 : !currentFiles setHasNoItems(noItems) - console.log('No items', noItems) }, [currentFiles, multiple]) const handleFileUpload = async (file) => { diff --git a/src/components/Dashboard/common/ObjectChildTable.jsx b/src/components/Dashboard/common/ObjectChildTable.jsx index 2ea48bc..c9a8d56 100644 --- a/src/components/Dashboard/common/ObjectChildTable.jsx +++ b/src/components/Dashboard/common/ObjectChildTable.jsx @@ -259,7 +259,6 @@ const ObjectChildTable = ({ if (rollup && typeof rollup.value === 'function') { try { const updatedObjectData = { ...objectData } - console.log('UPDATED OBJECT DATA', value) updatedObjectData[property.name] = value summaryRow[property.name] = rollup.value(updatedObjectData) } catch (e) { diff --git a/src/components/Dashboard/common/PrinterMiscPanel.jsx b/src/components/Dashboard/common/PrinterMiscPanel.jsx index 967749e..eb815a4 100644 --- a/src/components/Dashboard/common/PrinterMiscPanel.jsx +++ b/src/components/Dashboard/common/PrinterMiscPanel.jsx @@ -37,13 +37,11 @@ const PrinterMiscPanel = ({ id, showControls = true }) => { useEffect(() => { if (id && connected == true) { - console.log('subscribing to misc event') const miscEventUnsubscribe = subscribeToObjectEvent( id, 'printer', 'misc', (event) => { - console.log('misc event', event) setMiscData((prev) => { const merged = merge({}, prev, event.data) return merged diff --git a/src/components/Dashboard/common/PrinterPositionPanel.jsx b/src/components/Dashboard/common/PrinterPositionPanel.jsx index 6a8f921..17a671f 100644 --- a/src/components/Dashboard/common/PrinterPositionPanel.jsx +++ b/src/components/Dashboard/common/PrinterPositionPanel.jsx @@ -55,13 +55,11 @@ const PrinterPositionPanel = ({ useEffect(() => { if (id && connected == true) { - console.log('subscribing to motion event') const motionEventUnsubscribe = subscribeToObjectEvent( id, 'printer', 'motion', (event) => { - console.log('motion event', event) setPositionData((prev) => { const merged = merge({}, prev, event.data) return merged diff --git a/src/components/Dashboard/common/PrinterTemperaturePanel.jsx b/src/components/Dashboard/common/PrinterTemperaturePanel.jsx index 1d1f865..b38375a 100644 --- a/src/components/Dashboard/common/PrinterTemperaturePanel.jsx +++ b/src/components/Dashboard/common/PrinterTemperaturePanel.jsx @@ -101,9 +101,7 @@ const PrinterTemperaturePanel = ({ type: 'setTemperature', data }, - (result) => { - console.log('setTemperatureResult', result) - } + () => {} ) } } diff --git a/src/components/Dashboard/context/ActionsModalContext.jsx b/src/components/Dashboard/context/ActionsModalContext.jsx index c71fbdb..87adbcf 100644 --- a/src/components/Dashboard/context/ActionsModalContext.jsx +++ b/src/components/Dashboard/context/ActionsModalContext.jsx @@ -90,10 +90,7 @@ const ActionsModalProvider = ({ children }) => { // Use a small timeout to ensure the modal is fully rendered and visible setTimeout(() => { if (visible) { - console.log('visible', visible) - console.log('inputRef.current', inputRef.current) if (visible && inputRef.current) { - console.log('focusing input') const input = inputRef.current.input if (input) { input.focus() diff --git a/src/components/Dashboard/context/ApiServerContext.jsx b/src/components/Dashboard/context/ApiServerContext.jsx index cf39a72..7b976f8 100644 --- a/src/components/Dashboard/context/ApiServerContext.jsx +++ b/src/components/Dashboard/context/ApiServerContext.jsx @@ -89,8 +89,7 @@ const ApiServerProvider = ({ children }) => { newSocket.on('connect', () => { logger.debug('Api Server connected') - newSocket.emit('authenticate', { token: token }, (result) => { - console.log('Auth result', result) + newSocket.emit('authenticate', { token: token }, () => { setConnecting(false) setConnected(true) setError(null) @@ -328,11 +327,6 @@ const ApiServerProvider = ({ children }) => { const offObjectTypeUpdatesEvent = useCallback((objectType, callback) => { if (socketRef.current && socketRef.current.connected == true) { // Remove callback from the subscribed callbacks map - console.log( - 'Unsubscribing from type', - objectType, - subscribedCallbacksRef.current.has(objectType) - ) if (subscribedCallbacksRef.current.has(objectType)) { const callbacks = subscribedCallbacksRef.current .get(objectType) @@ -453,7 +447,6 @@ const ApiServerProvider = ({ children }) => { .filter((cb) => cb !== callback) if (callbacks.length === 0) { subscribedCallbacksRef.current.delete(callbacksRefKey) - console.log('Unsubscribing from object event:', callbacksRefKey) socketRef.current.emit('unsubscribeObjectEvent', { _id: id, objectType, @@ -481,7 +474,6 @@ const ApiServerProvider = ({ children }) => { subscribedCallbacksRef.current.get(callbacksRefKey).length if (callbacksLength <= 0) { - console.log('Subscribing to object event:', callbacksRefKey) socketRef.current.emit( 'subscribeToObjectEvent', {