Skip to content
This repository was archived by the owner on May 17, 2025. It is now read-only.

Commit 821cbf0

Browse files
committed
fix(settings): update tab index lookup approach
1 parent e77e663 commit 821cbf0

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

src/lib/ui/settings/patches/tabs.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { after } from "@lib/api/patcher";
22
import { findInReactTree } from "@lib/utils";
3-
import { i18n } from "@metro/common";
43
import { TableRow } from "@metro/common/components";
54
import { findByNameLazy, findByPropsLazy } from "@metro/wrappers";
65
import { registeredSections } from "@ui/settings";
@@ -75,8 +74,8 @@ export function patchTabsUI(unpatches: (() => void | boolean)[]) {
7574
if (useIsFirstRender()) return; // :shrug:
7675

7776
const { sections } = findInReactTree(ret, i => i.props?.sections).props;
78-
// TODO: Use new i18n lib
79-
let index = -~sections.findIndex((i: any) => i.label === i18n.Messages.ACCOUNT_SETTINGS) || 1;
77+
// Credit to @palmdevs - https://discord.com/channels/1196075698301968455/1243605828783571024/1307940348378742816
78+
let index = -~sections.findIndex((i: any) => i.settings.includes("ACCOUNT")) || 1;
8079

8180
Object.keys(registeredSections).forEach(sect => {
8281
sections.splice(index++, 0, {

0 commit comments

Comments
 (0)