From eeb4d2681264b03745b64a83ff5fc10247110d83 Mon Sep 17 00:00:00 2001 From: Nuckyz <61953774+Nuckyz@users.noreply.github.com> Date: Sat, 3 Aug 2024 14:48:05 -0300 Subject: [PATCH] forgot this --- src/components/VencordSettings/ThemesTab.tsx | 4 ++-- src/plugins/consoleShortcuts/index.ts | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/VencordSettings/ThemesTab.tsx b/src/components/VencordSettings/ThemesTab.tsx index 4aa2809da..6f9d2c561 100644 --- a/src/components/VencordSettings/ThemesTab.tsx +++ b/src/components/VencordSettings/ThemesTab.tsx @@ -28,7 +28,7 @@ import { Margins } from "@utils/margins"; import { classes } from "@utils/misc"; import { showItemInFolder } from "@utils/native"; import { useAwaiter } from "@utils/react"; -import { findByProps, findComponent } from "@webpack"; +import { findByProps, findComponentByFields } from "@webpack"; import { Card, Forms, React, showToast, TabBar, TextArea, useEffect, useRef, useState } from "@webpack/common"; import type { Ref, SyntheticEvent } from "react"; @@ -45,7 +45,7 @@ type FileInputProps = { filters?: { name?: string; extensions: string[]; }[]; }; -const FileInput = findComponent(m => m.prototype?.activateUploadDialogue && m.prototype.setRef); +const FileInput = findComponentByFields("activateUploadDialogue", "setRef"); const TextAreaProps = findByProps("textarea"); const cl = classNameFactory("vc-settings-theme-"); diff --git a/src/plugins/consoleShortcuts/index.ts b/src/plugins/consoleShortcuts/index.ts index 16c7e0e23..59c040794 100644 --- a/src/plugins/consoleShortcuts/index.ts +++ b/src/plugins/consoleShortcuts/index.ts @@ -92,10 +92,13 @@ function makeShortcuts() { findAll: cacheFindAll, findByProps, findAllByProps: (...props: string[]) => cacheFindAll(filters.byProps(...props)), + findProp: (...props: string[]) => findByProps(...props)[props[0]], findByCode: newFindWrapper(filters.byCode), findAllByCode: (code: string) => cacheFindAll(filters.byCode(code)), findComponentByCode: newFindWrapper(filters.componentByCode), findAllComponentsByCode: (...code: string[]) => cacheFindAll(filters.componentByCode(...code)), + findComponentByFields: newFindWrapper(filters.componentByFields), + findAllComponentsByFields: (...fields: string[]) => cacheFindAll(filters.componentByFields(...fields)), findExportedComponent: (...props: string[]) => findByProps(...props)[props[0]], findStore: newFindWrapper(filters.byStoreName), findByFactoryCode: newFindWrapper(filters.byFactoryCode),