diff --git a/src/ui/components/index.ts b/src/ui/components/index.ts index 0050bbf..496cbbf 100644 --- a/src/ui/components/index.ts +++ b/src/ui/components/index.ts @@ -1,10 +1,10 @@ import { ReactNative as RN } from "@metro/common"; -import { findByName, findByProps } from "@metro/filters"; +import { findByDisplayName, findByName, findByProps } from "@metro/filters"; // Discord export const Forms = findByProps("Form", "FormSection"); export const General = findByProps("Button", "Text", "View"); -export const Alert = findByProps("alertDarkStyles", "alertLightStyles").default; +export const Alert = findByDisplayName("FluxContainer(Alert)"); export const Button = findByProps("Looks", "Colors", "Sizes") as React.ComponentType & { Looks: any, Colors: any, Sizes: any }; export const HelpMessage = findByName("HelpMessage"); // React Native's included SafeAreaView only adds padding on iOS. diff --git a/src/ui/settings/index.ts b/src/ui/settings/index.ts index c4e32a3..8fd59b0 100644 --- a/src/ui/settings/index.ts +++ b/src/ui/settings/index.ts @@ -7,5 +7,5 @@ export default function initSettings() { patchYou(), ] - return () => patches.forEach(p => p()); + return () => patches.forEach(p => p?.()); } diff --git a/src/ui/settings/patches/you.tsx b/src/ui/settings/patches/you.tsx index 627886d..6c96022 100644 --- a/src/ui/settings/patches/you.tsx +++ b/src/ui/settings/patches/you.tsx @@ -18,7 +18,7 @@ const getterFunctionName = usingNewGettersModule ? NEW_GETTER_FUNCTION : OLD_GET const gettersModule = oldGettersModule ?? findByProps(NEW_GETTER_FUNCTION); export default function patchYou() { - if (!gettersModule) return; + if (!gettersModule || !layoutModule) return; const patches = new Array; const screens = getScreens(true);