mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-16 09:57:08 -04:00
fix PronounDB crash with new profile in dms, force start dependencies
This commit is contained in:
parent
b48c8d8a4a
commit
81edc14070
8 changed files with 80 additions and 24 deletions
|
@ -22,8 +22,13 @@ import { Margins, React } from "../webpack/common";
|
|||
import { ErrorCard } from "./ErrorCard";
|
||||
|
||||
interface Props {
|
||||
/** Render nothing if an error occurs */
|
||||
noop?: boolean;
|
||||
/** Fallback component to render if an error occurs */
|
||||
fallback?: React.ComponentType<React.PropsWithChildren<{ error: any; message: string; stack: string; }>>;
|
||||
/** called when an error occurs */
|
||||
onError?(error: Error, errorInfo: React.ErrorInfo): void;
|
||||
/** Custom error message */
|
||||
message?: string;
|
||||
}
|
||||
|
||||
|
@ -67,6 +72,8 @@ const ErrorBoundary = LazyComponent(() => {
|
|||
render() {
|
||||
if (this.state.error === NO_ERROR) return this.props.children;
|
||||
|
||||
if (this.props.noop) return null;
|
||||
|
||||
if (this.props.fallback)
|
||||
return <this.props.fallback
|
||||
children={this.props.children}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue