mirror of
https://github.com/semantica-agi/semantica.git
synced 2026-08-29 04:26:20 +00:00
fix(#768): remove componentDidUpdate auto-reset to avoid premature reset on Suspense fallback
This commit is contained in:
@@ -25,15 +25,7 @@ export class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundarySt
|
||||
console.error("ErrorBoundary caught an error:", error, errorInfo);
|
||||
}
|
||||
|
||||
componentDidUpdate(_prevProps: ErrorBoundaryProps, prevState: ErrorBoundaryState) {
|
||||
// If the component has successfully rendered (hasError is false)
|
||||
// and we were previously tracking retries, reset the retry counter.
|
||||
// By checking prevState.hasError, we ensure this reset only triggers
|
||||
// exactly once upon the recovery transition.
|
||||
if (prevState.hasError && !this.state.hasError && this.state.retryCount > 0) {
|
||||
this.setState({ retryCount: 0 });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
resetErrorBoundary = () => {
|
||||
this.setState((prev) => ({
|
||||
|
||||
Reference in New Issue
Block a user