From 80e2a93a8cbfbb1afdaa599e2c45fd5c4ad0ff79 Mon Sep 17 00:00:00 2001 From: Simon <10131203+gaomeng1900@users.noreply.github.com> Date: Sat, 7 Mar 2026 23:16:03 +0800 Subject: [PATCH] feat: add button to clear saved configuration from the error boundary --- .../sidepanel/components/ErrorBoundary.tsx | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/packages/extension/src/entrypoints/sidepanel/components/ErrorBoundary.tsx b/packages/extension/src/entrypoints/sidepanel/components/ErrorBoundary.tsx index f04a1a0..178779c 100644 --- a/packages/extension/src/entrypoints/sidepanel/components/ErrorBoundary.tsx +++ b/packages/extension/src/entrypoints/sidepanel/components/ErrorBoundary.tsx @@ -1,4 +1,4 @@ -import { AlertTriangle, RotateCcw } from 'lucide-react' +import { AlertTriangle, Eraser, RotateCcw } from 'lucide-react' import { Component, type ErrorInfo, type ReactNode } from 'react' import { Button } from '@/components/ui/button' @@ -27,6 +27,11 @@ export class ErrorBoundary extends Component { window.location.reload() } + handleResetConfig = async () => { + await chrome.storage.local.remove(['llmConfig', 'language', 'advancedConfig']) + window.location.reload() + } + render() { if (!this.state.hasError) { return this.props.children @@ -39,10 +44,16 @@ export class ErrorBoundary extends Component {

{this.state.error?.message || 'An unexpected error occurred'}

- +
+ + +
) }