From 1f3a10736986c2e9fec951705bd979a09eae7ffc Mon Sep 17 00:00:00 2001 From: "roomote[bot]" <219738659+roomote[bot]@users.noreply.github.com> Date: Mon, 28 Jul 2025 14:46:05 -0400 Subject: [PATCH] fix: hide Test ErrorBoundary button in production mode (#6216) Co-authored-by: Roo Code --- webview-ui/src/components/settings/About.tsx | 32 +------------------- 1 file changed, 1 insertion(+), 31 deletions(-) diff --git a/webview-ui/src/components/settings/About.tsx b/webview-ui/src/components/settings/About.tsx index 01979060c3..5075643e6e 100644 --- a/webview-ui/src/components/settings/About.tsx +++ b/webview-ui/src/components/settings/About.tsx @@ -1,4 +1,4 @@ -import { HTMLAttributes, useState } from "react" +import { HTMLAttributes } from "react" import { useAppTranslation } from "@/i18n/TranslationContext" import { Trans } from "react-i18next" import { Info, Download, Upload, TriangleAlert } from "lucide-react" @@ -22,33 +22,9 @@ type AboutProps = HTMLAttributes & { export const About = ({ telemetrySetting, setTelemetrySetting, className, ...props }: AboutProps) => { const { t } = useAppTranslation() - const [shouldThrowError, setShouldThrowError] = useState(false) - - // Function to trigger error for testing ErrorBoundary - const triggerTestError = () => { - setShouldThrowError(true) - } - - // Named function to make it easier to identify in stack traces - function throwTestError() { - // Intentionally cause a type error by accessing a property on undefined - const obj: any = undefined - obj.nonExistentMethod() - } - - // Test component that throws an error when shouldThrow is true - const ErrorThrower = ({ shouldThrow = false }) => { - if (shouldThrow) { - // Use a named function to make it easier to identify in stack traces - throwTestError() - } - return null - } return (
- {/* Test component that throws an error when shouldThrow is true */} - {t("settings:footer.settings.reset")} - - {/* Test button for ErrorBoundary - only visible in development */} -