Skip to content

Commit

Permalink
fix(ErrorBoundary): use same conditions as Valve boundary for rendering
Browse files Browse the repository at this point in the history
this fixes the screenshot deletion error
  • Loading branch information
AAGaming00 committed Jan 4, 2025
1 parent ceb10fd commit 0545175
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions frontend/src/errorboundary-hook.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,17 @@ class ErrorBoundaryHook extends Logger {
this.setState(stateClone);
return null;
}
if (this.state.error) {
// yoinked from valve error boundary
if (this.state.error && this.props.errorKey == this.state.lastErrorKey) {
const store = Object.getPrototypeOf(this)?.constructor?.sm_ErrorReportingStore || errorReportingStore;
return (

return void 0 !== this.props.fallback ? (
'function' == typeof this.props.fallback ? (
this.props.fallback(this.state.error.error)
) : (
this.props.fallback
)
) : (
<DeckyErrorBoundary
error={this.state.error}
errorKey={this.props.errorKey}
Expand Down

0 comments on commit 0545175

Please sign in to comment.