From 821cbf01f2b16d8ba454fdbcf41efcb754607152 Mon Sep 17 00:00:00 2001 From: pylixonly <82711525+pylixonly@users.noreply.github.com> Date: Wed, 12 Feb 2025 22:03:04 +0800 Subject: [PATCH] fix(settings): update tab index lookup approach --- src/lib/ui/settings/patches/tabs.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/lib/ui/settings/patches/tabs.tsx b/src/lib/ui/settings/patches/tabs.tsx index 1c23eab..4443682 100644 --- a/src/lib/ui/settings/patches/tabs.tsx +++ b/src/lib/ui/settings/patches/tabs.tsx @@ -1,6 +1,5 @@ import { after } from "@lib/api/patcher"; import { findInReactTree } from "@lib/utils"; -import { i18n } from "@metro/common"; import { TableRow } from "@metro/common/components"; import { findByNameLazy, findByPropsLazy } from "@metro/wrappers"; import { registeredSections } from "@ui/settings"; @@ -75,8 +74,8 @@ export function patchTabsUI(unpatches: (() => void | boolean)[]) { if (useIsFirstRender()) return; // :shrug: const { sections } = findInReactTree(ret, i => i.props?.sections).props; - // TODO: Use new i18n lib - let index = -~sections.findIndex((i: any) => i.label === i18n.Messages.ACCOUNT_SETTINGS) || 1; + // Credit to @palmdevs - https://discord.com/channels/1196075698301968455/1243605828783571024/1307940348378742816 + let index = -~sections.findIndex((i: any) => i.settings.includes("ACCOUNT")) || 1; Object.keys(registeredSections).forEach(sect => { sections.splice(index++, 0, {