From 244d10dc9eafe5b9daf266e3a3880c888e4de540 Mon Sep 17 00:00:00 2001 From: Vendicated Date: Fri, 5 May 2023 16:48:35 +0200 Subject: [skip ci] Fix handleComponentFailed spam --- src/components/VencordSettings/Updater.tsx | 3 ++- src/components/VencordSettings/index.tsx | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'src/components/VencordSettings') 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) { ; } +const onError = onlyOnce(handleComponentFailed); + export default function (props: SettingsProps) { - return + return ; } -- cgit