From 087742077cefaf39a0d1492f9f161e20d1e8a97a Mon Sep 17 00:00:00 2001 From: joseplayero Date: Fri, 30 Aug 2024 22:08:43 +0100 Subject: [PATCH 1/2] sentry in production --- electron/main/index.ts | 8 ++++++-- src/main.tsx | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) 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/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() From ef840bc19c145e332181c1fda690ea3f0dccef30 Mon Sep 17 00:00:00 2001 From: milaiwi Date: Sat, 31 Aug 2024 12:43:21 -0500 Subject: [PATCH 2/2] Fixed bottom note bug. --- src/components/Sidebars/FileSideBar/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Sidebars/FileSideBar/index.tsx b/src/components/Sidebars/FileSideBar/index.tsx index e0477a2d..9e79b20d 100644 --- a/src/components/Sidebars/FileSideBar/index.tsx +++ b/src/components/Sidebars/FileSideBar/index.tsx @@ -51,11 +51,11 @@ const FileExplorer: React.FC = ({ handleDirectoryToggle, lheight, }) => { - const [listHeight, setListHeight] = useState(lheight ?? window.innerHeight) + const [listHeight, setListHeight] = useState(lheight ?? window.innerHeight - 50) useEffect(() => { const updateHeight = () => { - setListHeight(lheight ?? window.innerHeight) + setListHeight(lheight ?? window.innerHeight - 50) } window.addEventListener('resize', updateHeight) return () => {