diff --git a/electron/main/index.ts b/electron/main/index.ts index 86a17242..61e81619 100644 --- a/electron/main/index.ts +++ b/electron/main/index.ts @@ -68,12 +68,16 @@ app.on('activate', () => { process.on('uncaughtException', (error: Error) => { windowsManager.appendNewErrorToDisplayInWindow(errorToStringMainProcess(error)) - Sentry.captureException(error) + if (process.env.NODE_ENV === 'production') { + Sentry.captureException(error) + } }) process.on('unhandledRejection', (reason: unknown) => { windowsManager.appendNewErrorToDisplayInWindow(errorToStringMainProcess(reason)) - Sentry.captureException(reason as Error) + if (process.env.NODE_ENV === 'production') { + Sentry.captureException(reason as Error) + } }) registerLLMSessionHandlers(store) diff --git a/src/components/Sidebars/FileSideBar/FileExplorer.tsx b/src/components/Sidebars/FileSideBar/FileExplorer.tsx index 0094e842..c0a26398 100644 --- a/src/components/Sidebars/FileSideBar/FileExplorer.tsx +++ b/src/components/Sidebars/FileSideBar/FileExplorer.tsx @@ -12,13 +12,12 @@ interface FileExplorerProps { } const FileExplorer: React.FC = ({ lheight }) => { - const [listHeight, setListHeight] = useState(lheight ?? window.innerHeight) - + const [listHeight, setListHeight] = useState(lheight ?? window.innerHeight - 50) const { files, expandedDirectories } = useFileContext() useEffect(() => { const updateHeight = () => { - setListHeight(lheight ?? window.innerHeight) + setListHeight(lheight ?? window.innerHeight - 50) } window.addEventListener('resize', updateHeight) return () => { diff --git a/src/main.tsx b/src/main.tsx index f5baea6d..253c01f4 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -15,13 +15,17 @@ Sentry.init({ window.addEventListener('error', (event) => { event.preventDefault() toast.error(errorToStringRendererProcess(event.error)) - Sentry.captureException(event.error) + if (process.env.NODE_ENV === 'production') { + Sentry.captureException(event.error) + } }) window.addEventListener('unhandledrejection', (event) => { event.preventDefault() toast.error(errorToStringRendererProcess(event.reason)) - Sentry.captureException(event.reason) + if (process.env.NODE_ENV === 'production') { + Sentry.captureException(event.reason) + } }) ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render()