From b7a3580ccf0963d6519ee0634b6508888c1372b5 Mon Sep 17 00:00:00 2001 From: redstonekasi Date: Tue, 4 Apr 2023 17:52:49 +0200 Subject: [PATCH] [UI > Settings] Fix for latest Discord releases --- src/ui/settings/index.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/ui/settings/index.tsx b/src/ui/settings/index.tsx index ac1c47e..98e5dee 100644 --- a/src/ui/settings/index.tsx +++ b/src/ui/settings/index.tsx @@ -12,6 +12,7 @@ import Plugins from "@ui/settings/pages/Plugins"; import Themes from "@ui/settings/pages/Themes"; import Developer from "@ui/settings/pages/Developer"; import AssetBrowser from "@ui/settings/pages/AssetBrowser"; +import { Forms } from "@ui/components"; const screensModule = findByName("getScreens", false); const settingsModule = findByName("UserSettingsOverviewWrapper", false); @@ -67,10 +68,12 @@ export default function initSettings() { patches.push(after("render", Overview.type.prototype, (_, { props: { children } }) => { const titles = [i18n.Messages["BILLING_SETTINGS"], i18n.Messages["PREMIUM_SETTINGS"]]; - const index = children.findIndex((c: any) => titles.includes(c.props.title)); + //! Fix for Android 174201 and iOS 42188 + children = findInReactTree(children, (tree) => tree.children[1].type === Forms.FormSection).children; + const index = children.findIndex((c: any) => titles.includes(c?.props.label)); children.splice(index === -1 ? 4 : index, 0, ); })); }, true); return () => patches.forEach(p => p()); -} \ No newline at end of file +}