Skip to content

Commit

Permalink
fix(settings): update tab index lookup approach
Browse files Browse the repository at this point in the history
  • Loading branch information
pylixonly committed Feb 12, 2025
1 parent e77e663 commit 821cbf0
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/lib/ui/settings/patches/tabs.tsx
Original file line number Diff line number Diff line change
@@ -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";
Expand Down Expand Up @@ -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, {
Expand Down

0 comments on commit 821cbf0

Please sign in to comment.