aboutsummaryrefslogtreecommitdiff
path: root/src/components/VencordSettings
diff options
context:
space:
mode:
authorVendicated <vendicated@riseup.net>2023-05-05 16:48:35 +0200
committerVendicated <vendicated@riseup.net>2023-05-05 16:57:58 +0200
commit244d10dc9eafe5b9daf266e3a3880c888e4de540 (patch)
tree7be248df0997a861637efdeae209d7c578fac160 /src/components/VencordSettings
parentc25bc0ff4b597131ed223fd5c1a8cf75ac5282e3 (diff)
downloadVencord-244d10dc9eafe5b9daf266e3a3880c888e4de540.tar.gz
Vencord-244d10dc9eafe5b9daf266e3a3880c888e4de540.tar.bz2
Vencord-244d10dc9eafe5b9daf266e3a3880c888e4de540.zip
[skip ci] Fix handleComponentFailed spam
Diffstat (limited to 'src/components/VencordSettings')
-rw-r--r--src/components/VencordSettings/Updater.tsx3
-rw-r--r--src/components/VencordSettings/index.tsx5
2 files changed, 6 insertions, 2 deletions
diff --git a/src/components/VencordSettings/Updater.tsx b/src/components/VencordSettings/Updater.tsx
index fb78394..6fec9e7 100644
--- a/src/components/VencordSettings/Updater.tsx
+++ b/src/components/VencordSettings/Updater.tsx
@@ -25,6 +25,7 @@ import { Link } from "@components/Link";
import { Margins } from "@utils/margins";
import { classes, useAwaiter } from "@utils/misc";
import { relaunch } from "@utils/native";
+import { onlyOnce } from "@utils/onlyOnce";
import { changes, checkForUpdates, getRepo, isNewer, update, updateError, UpdateLogger } from "@utils/updater";
import { Alerts, Button, Card, Forms, Parser, React, Switch, Toasts } from "@webpack/common";
@@ -250,5 +251,5 @@ function Updater() {
export default IS_WEB ? null : ErrorBoundary.wrap(Updater, {
message: "Failed to render the Updater. If this persists, try using the installer to reinstall!",
- onError: handleComponentFailed,
+ onError: onlyOnce(handleComponentFailed),
});
diff --git a/src/components/VencordSettings/index.tsx b/src/components/VencordSettings/index.tsx
index b2916c4..6d65aa1 100644
--- a/src/components/VencordSettings/index.tsx
+++ b/src/components/VencordSettings/index.tsx
@@ -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>;
}