From 83f5b20168f9af98a5524347f982bb07d5508707 Mon Sep 17 00:00:00 2001 From: Tom Butcher Date: Thu, 23 Jul 2026 21:44:15 +0100 Subject: [PATCH] Remove unnecessary console.log statements across multiple files to clean up the codebase and improve performance. This includes updates in appupdate.js, macappupdate.js, mainWindow.js, and various components in the Dashboard context. --- public/appupdate.js | 1 - public/macappupdate.js | 9 --------- public/mainWindow.js | 8 +------- public/winappupdate.js | 9 +-------- src/components/Dashboard/Production/Jobs/DeployJob.jsx | 2 -- src/components/Dashboard/common/FilePreview.jsx | 1 - src/components/Dashboard/common/Notification.jsx | 6 +----- src/components/Dashboard/common/ObjectChildTable.jsx | 1 - src/components/Dashboard/context/ApiServerContext.jsx | 2 -- src/components/Dashboard/context/AuthContext.jsx | 6 ------ src/components/Email/EmailNotificationTemplate.jsx | 1 - src/database/models/ListingVarient.js | 1 - src/database/models/OrderItem.js | 1 - 13 files changed, 3 insertions(+), 45 deletions(-) diff --git a/public/appupdate.js b/public/appupdate.js index eac09ed..52201bc 100644 --- a/public/appupdate.js +++ b/public/appupdate.js @@ -184,7 +184,6 @@ const downloadArtifact = async (artifact, destinationPath, webContents) => { } const restartApp = (app) => { - console.log('[app-update] restarting app') app.relaunch() app.exit(0) } diff --git a/public/macappupdate.js b/public/macappupdate.js index 1a38d2f..9995bda 100644 --- a/public/macappupdate.js +++ b/public/macappupdate.js @@ -111,13 +111,6 @@ export const launchMacInstaller = ( const installScript = buildMacInstallScript(installerPath, logPath) const promptName = 'farmcontrol' - console.log('[app-update] launching macOS installer:', { - installerPath, - installScript, - logPath, - promptName - }) - sendProgress(webContents, { phase: 'installing', percent: 0, @@ -140,7 +133,6 @@ export const launchMacInstaller = ( await fs.unlink(logPath).catch(() => {}) - if (stdout) console.log('[app-update] installer stdout:', stdout) if (stderr) console.error('[app-update] installer stderr:', stderr) if (error) { @@ -174,7 +166,6 @@ export const launchMacInstaller = ( message: message || 'Installation complete. Restarting Farm Control...' }) - console.log('[app-update] installer completed successfully') resolve() }) }) diff --git a/public/mainWindow.js b/public/mainWindow.js index 39f6d66..2b1b59e 100644 --- a/public/mainWindow.js +++ b/public/mainWindow.js @@ -157,7 +157,6 @@ function setupWindowEvents() { }) }) win.on('enter-full-screen', () => { - console.log('Entered fullscreen') win.webContents.send('window-state', { isFullScreen: true }) @@ -293,7 +292,6 @@ export function setupMainWindowAppEvents(app) { export function setupDevAuthServer() { const env = (process.env.NODE_ENV || 'development').trim() if (env == 'development') { - console.log('Starting development auth web server...') import('express').then(({ default: express }) => { const app = express() const port = 3500 @@ -310,11 +308,7 @@ export function setupDevAuthServer() { } }) - app.listen(port, () => { - console.log(`Dev auth server running on http://localhost:${port}`) - }) + app.listen(port, () => {}) }) - } else { - console.log('Will use url scheme instead of auth server.') } } diff --git a/public/winappupdate.js b/public/winappupdate.js index 95b3321..ba9fd36 100644 --- a/public/winappupdate.js +++ b/public/winappupdate.js @@ -9,14 +9,7 @@ const DEBUG_PREFIX = '[app-update][win-progress]' const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms)) -const debugLog = (message, details) => { - if (details === undefined) { - console.log(`${DEBUG_PREFIX} ${message}`) - return - } - - console.log(`${DEBUG_PREFIX} ${message}`, details) -} +const debugLog = () => {} const decodeMsiLogBuffer = (buffer) => { if (!buffer?.length) return '' diff --git a/src/components/Dashboard/Production/Jobs/DeployJob.jsx b/src/components/Dashboard/Production/Jobs/DeployJob.jsx index 09f2bc6..bbe40b7 100644 --- a/src/components/Dashboard/Production/Jobs/DeployJob.jsx +++ b/src/components/Dashboard/Production/Jobs/DeployJob.jsx @@ -66,8 +66,6 @@ const DeployJob = ({ } }, [objectData]) - console.log(objectData) - const steps = [ { title: 'Confirm', diff --git a/src/components/Dashboard/common/FilePreview.jsx b/src/components/Dashboard/common/FilePreview.jsx index 9a3a0b6..c6b1972 100644 --- a/src/components/Dashboard/common/FilePreview.jsx +++ b/src/components/Dashboard/common/FilePreview.jsx @@ -19,7 +19,6 @@ const FilePreview = ({ file, style = {} }) => { return } setLoading(true) - console.log('fetching file content', file) const objectUrl = await fetchFileContent(file, false) if (objectUrl == null) { setLoading(false) diff --git a/src/components/Dashboard/common/Notification.jsx b/src/components/Dashboard/common/Notification.jsx index 4674c3c..d7bd2cc 100644 --- a/src/components/Dashboard/common/Notification.jsx +++ b/src/components/Dashboard/common/Notification.jsx @@ -1,4 +1,4 @@ -import { useState, useEffect } from 'react' +import { useState } from 'react' import PropTypes from 'prop-types' import { Typography, Button, Tag, Badge, Flex, Card, Divider } from 'antd' import { @@ -31,10 +31,6 @@ const Notification = ({ }) => { const [deleting, setDeleting] = useState(false) - useEffect(() => { - console.log('notificationData', JSON.stringify(notification)) - }, [notification]) - const getNotificationIcon = (type) => { switch (type) { case 'info': diff --git a/src/components/Dashboard/common/ObjectChildTable.jsx b/src/components/Dashboard/common/ObjectChildTable.jsx index c58b9ba..62ecf44 100644 --- a/src/components/Dashboard/common/ObjectChildTable.jsx +++ b/src/components/Dashboard/common/ObjectChildTable.jsx @@ -376,7 +376,6 @@ const ObjectChildTable = ({ const currentItems = Array.isArray(itemsSource) ? itemsSource : [] const newItems = [...currentItems, newItem] - console.log('newItems', newItems) if (typeof onChange === 'function') { onChange(newItems) } diff --git a/src/components/Dashboard/context/ApiServerContext.jsx b/src/components/Dashboard/context/ApiServerContext.jsx index 82b21cd..d7f68b5 100644 --- a/src/components/Dashboard/context/ApiServerContext.jsx +++ b/src/components/Dashboard/context/ApiServerContext.jsx @@ -1770,8 +1770,6 @@ const ApiServerProvider = ({ children }) => { 'launchSession' ) - console.log(new URLSearchParams(location.search)) - if ( authenticated !== true || !token || diff --git a/src/components/Dashboard/context/AuthContext.jsx b/src/components/Dashboard/context/AuthContext.jsx index 4df271e..f7cb529 100644 --- a/src/components/Dashboard/context/AuthContext.jsx +++ b/src/components/Dashboard/context/AuthContext.jsx @@ -303,8 +303,6 @@ const AuthProvider = ({ children }) => { profileImage?._id ?? (typeof profileImage === 'string' ? profileImage : null) - console.log('Fetching profile image:', profileImageId) - if (!token) { if (profileImageUrlRef.current) { URL.revokeObjectURL(profileImageUrlRef.current) @@ -372,10 +370,6 @@ const AuthProvider = ({ children }) => { } }, [userProfile?.profileImage, token]) - useEffect(() => { - console.log('userProfile', userProfile) - }, [userProfile]) - const logout = useCallback( (redirectUri = '/login') => { setAuthenticated(false) diff --git a/src/components/Email/EmailNotificationTemplate.jsx b/src/components/Email/EmailNotificationTemplate.jsx index 7f1c5b9..efc494f 100644 --- a/src/components/Email/EmailNotificationTemplate.jsx +++ b/src/components/Email/EmailNotificationTemplate.jsx @@ -57,7 +57,6 @@ const EmailNotificationTemplate = () => { ) } case 'newNote': { - console.log('newNote metadata', JSON.stringify(metadata, null, 2)) const model = getModelByName(metadata?.note?.parentType) const infoAction = model.actions?.find((action) => action.name === 'info') ?? null diff --git a/src/database/models/ListingVarient.js b/src/database/models/ListingVarient.js index f35f4c3..66a4aa6 100644 --- a/src/database/models/ListingVarient.js +++ b/src/database/models/ListingVarient.js @@ -161,7 +161,6 @@ export const ListingVarient = { showHyperlink: true, readOnly: true, value: (objectData) => { - console.log('listing product id', objectData?.listing?.product?._id) return objectData?.listing?.product }, required: true, diff --git a/src/database/models/OrderItem.js b/src/database/models/OrderItem.js index 6089d2f..9ff5676 100644 --- a/src/database/models/OrderItem.js +++ b/src/database/models/OrderItem.js @@ -244,7 +244,6 @@ export const OrderItem = { showHyperlink: true, columnWidth: 300, masterFilter: (objectData) => { - console.log(objectData) if (objectData?.itemType === 'filament' && objectData?.item?._id) { return { filament: objectData.item._id } }