Removed console.log statements from various components to clean up the code and improve performance.
This commit is contained in:
parent
9f05bfd929
commit
4995d37aa2
@ -54,7 +54,6 @@ const FileUpload = ({
|
||||
currentFiles.length === 0
|
||||
: !currentFiles
|
||||
setHasNoItems(noItems)
|
||||
console.log('No items', noItems)
|
||||
}, [currentFiles, multiple])
|
||||
|
||||
const handleFileUpload = async (file) => {
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -101,9 +101,7 @@ const PrinterTemperaturePanel = ({
|
||||
type: 'setTemperature',
|
||||
data
|
||||
},
|
||||
(result) => {
|
||||
console.log('setTemperatureResult', result)
|
||||
}
|
||||
() => {}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@ -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()
|
||||
|
||||
@ -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',
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user