better handling for settings ui errors

This commit is contained in:
Vendicated 2022-11-15 17:29:31 +01:00
parent eabbf7d9bd
commit b30508aef8
No known key found for this signature in database
GPG key ID: EC781ADFB93EFFA3
5 changed files with 60 additions and 4 deletions

View file

@ -23,6 +23,7 @@ import { useAwaiter } from "../utils/misc";
import { Alerts, Button, Forms, Margins, Parser, React, Switch } from "../webpack/common";
import ErrorBoundary from "./ErrorBoundary";
import { Flex } from "./Flex";
import { handleComponentFailed } from "./handleComponentFailed";
export default ErrorBoundary.wrap(function Settings() {
const [settingsDir, , settingsDirPending] = useAwaiter(() => VencordNative.ipc.invoke<string>(IpcEvents.GET_SETTINGS_DIR), "Loading...");
@ -115,4 +116,7 @@ export default ErrorBoundary.wrap(function Settings() {
</Switch>}
</Forms.FormSection >
);
}, {
message: "Failed to render the Settings. If this persists, try using the installer to reinstall!",
onError: handleComponentFailed,
});