1- import { HTMLAttributes , useState } from "react"
1+ import { HTMLAttributes } from "react"
22import { useAppTranslation } from "@/i18n/TranslationContext"
33import { Trans } from "react-i18next"
44import { Info , Download , Upload , TriangleAlert } from "lucide-react"
@@ -22,33 +22,9 @@ type AboutProps = HTMLAttributes<HTMLDivElement> & {
2222
2323export const About = ( { telemetrySetting, setTelemetrySetting, className, ...props } : AboutProps ) => {
2424 const { t } = useAppTranslation ( )
25- const [ shouldThrowError , setShouldThrowError ] = useState ( false )
26-
27- // Function to trigger error for testing ErrorBoundary
28- const triggerTestError = ( ) => {
29- setShouldThrowError ( true )
30- }
31-
32- // Named function to make it easier to identify in stack traces
33- function throwTestError ( ) {
34- // Intentionally cause a type error by accessing a property on undefined
35- const obj : any = undefined
36- obj . nonExistentMethod ( )
37- }
38-
39- // Test component that throws an error when shouldThrow is true
40- const ErrorThrower = ( { shouldThrow = false } ) => {
41- if ( shouldThrow ) {
42- // Use a named function to make it easier to identify in stack traces
43- throwTestError ( )
44- }
45- return null
46- }
4725
4826 return (
4927 < div className = { cn ( "flex flex-col gap-2" , className ) } { ...props } >
50- { /* Test component that throws an error when shouldThrow is true */ }
51- < ErrorThrower shouldThrow = { shouldThrowError } />
5228 < SectionHeader
5329 description = {
5430 Package . sha
@@ -108,12 +84,6 @@ export const About = ({ telemetrySetting, setTelemetrySetting, className, ...pro
10884 < TriangleAlert className = "p-0.5" />
10985 { t ( "settings:footer.settings.reset" ) }
11086 </ Button >
111-
112- { /* Test button for ErrorBoundary - only visible in development */ }
113- < Button variant = "destructive" onClick = { triggerTestError } className = "w-auto" >
114- < TriangleAlert className = "p-0.5" />
115- Test ErrorBoundary
116- </ Button >
11787 </ div >
11888 </ Section >
11989 </ div >
0 commit comments