avoid showing ugly red error cards to users

This commit is contained in:
Vendicated 2025-06-06 18:48:56 +02:00
parent e7076f5aee
commit fae15dbdfe
No known key found for this signature in database
GPG key ID: D66986BAF75ECF18
11 changed files with 20 additions and 18 deletions

View file

@ -75,10 +75,15 @@ const ErrorBoundary = LazyComponent(() => {
logger.error(`${this.props.message || "A component threw an Error"}\n`, error, errorInfo.componentStack);
}
get isNoop() {
if (IS_DEV) return false;
return this.props.noop;
}
render() {
if (this.state.error === NO_ERROR) return this.props.children;
if (this.props.noop) return null;
if (this.isNoop) return null;
if (this.props.fallback)
return (