From e32d331c5eb8a11867c779ed29e5f160c7c68292 Mon Sep 17 00:00:00 2001 From: Beef Date: Thu, 27 Oct 2022 18:14:01 +0100 Subject: [PATCH] [Settings] Move to proper one-time patch --- src/ui/settings/index.tsx | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/ui/settings/index.tsx b/src/ui/settings/index.tsx index 8194172..4efd433 100644 --- a/src/ui/settings/index.tsx +++ b/src/ui/settings/index.tsx @@ -2,30 +2,29 @@ import { React, i18n } from "@metro/common"; import { findByDisplayName } from "@metro/filters"; import { after } from "@lib/patcher"; import findInReactTree from "@utils/findInReactTree"; -import SettingsSection from "./components/SettingsSection"; -import General from "./components/General"; -import AssetBrowser from "./components/AssetBrowser"; +import SettingsSection from "@ui/settings/components/SettingsSection"; +import General from "@ui/settings/pages/General"; +import AssetBrowser from "@ui/settings/pages/AssetBrowser"; const screensModule = findByDisplayName("getScreens", false); const settingsModule = findByDisplayName("UserSettingsOverviewWrapper", false); export default function initSettings() { - const screensPatch = after("default", screensModule, (args, ret) => { + after("default", screensModule, (args, ret) => { return { ...ret, VendettaSettings: { title: "Vendetta", - render: General + render: General, }, VendettaAssetBrowser: { title: "Asset Browser", - render: AssetBrowser - } + render: AssetBrowser, + }, } }); - const settingsPatch = after("default", settingsModule, (args, _ret) => { - settingsPatch(); + after("default", settingsModule, (args, _ret) => { const toPatch = findInReactTree(_ret.props.children, i => i.type && i.type.name === "UserSettingsOverview"); // Upload logs button gone @@ -39,5 +38,5 @@ export default function initSettings() { const index = children.findIndex((c: any) => titles.includes(c.props.title)); children.splice(index === -1 ? 4 : index, 0, ); }); - }); + }, true); } \ No newline at end of file