[skip ci] Fix handleComponentFailed spam

This commit is contained in:
Vendicated 2023-05-05 16:48:35 +02:00
parent c25bc0ff4b
commit 244d10dc9e
No known key found for this signature in database
GPG key ID: A1DC0CFB5615D905
5 changed files with 38 additions and 4 deletions

View file

@ -22,6 +22,7 @@ import { classNameFactory } from "@api/Styles";
import ErrorBoundary from "@components/ErrorBoundary";
import { handleComponentFailed } from "@components/handleComponentFailed";
import { isMobile } from "@utils/misc";
import { onlyOnce } from "@utils/onlyOnce";
import { Forms, SettingsRouter, TabBar, Text } from "@webpack/common";
import BackupRestoreTab from "./BackupRestoreTab";
@ -86,8 +87,10 @@ function Settings(props: SettingsProps) {
</Forms.FormSection >;
}
const onError = onlyOnce(handleComponentFailed);
export default function (props: SettingsProps) {
return <ErrorBoundary onError={handleComponentFailed}>
return <ErrorBoundary onError={onError}>
<Settings tab={props.tab} />
</ErrorBoundary>;
}