Settings should be wrapped in ErrorBoundary

This commit is contained in:
Vendicated
2025-02-06 04:13:03 +01:00
parent 2e72fa6589
commit 57cae6f9f1

View File

@@ -6,6 +6,7 @@
import "./settings.css"; import "./settings.css";
import { ErrorBoundary } from "@vencord/types/components";
import { Forms, Switch, Text } from "@vencord/types/webpack/common"; import { Forms, Switch, Text } from "@vencord/types/webpack/common";
import { ComponentType } from "react"; import { ComponentType } from "react";
import { Settings, useSettings } from "renderer/settings"; import { Settings, useSettings } from "renderer/settings";
@@ -155,7 +156,8 @@ function SettingsSections() {
return <>{sections}</>; return <>{sections}</>;
} }
export default function SettingsUi() { export default ErrorBoundary.wrap(
function SettingsUI() {
return ( return (
<Forms.FormSection> <Forms.FormSection>
<Text variant="heading-lg/semibold" style={{ color: "var(--header-primary)" }} tag="h2"> <Text variant="heading-lg/semibold" style={{ color: "var(--header-primary)" }} tag="h2">
@@ -165,4 +167,9 @@ export default function SettingsUi() {
<SettingsSections /> <SettingsSections />
</Forms.FormSection> </Forms.FormSection>
); );
} },
{
message:
"Failed to render the Vesktop Settings tab. If this issue persists, try to right click the Vesktop tray icon, then click 'Repair Vencord'. And make sure your Vesktop is up to date."
}
);