From a86b96333061e878f8df9c2f67b0f3fa6d71b888 Mon Sep 17 00:00:00 2001 From: Amsyar Rasyiq <82711525+amsyarasyiq@users.noreply.github.com> Date: Sat, 19 Aug 2023 02:42:34 +0800 Subject: [PATCH] [Global] Fix Vendetta on 193.4 (193204) (#136) --- src/ui/components/index.ts | 4 ++-- src/ui/settings/index.ts | 2 +- src/ui/settings/patches/you.tsx | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) 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);