forgot this

This commit is contained in:
Nuckyz 2024-08-03 14:48:05 -03:00
parent 2429c283aa
commit eeb4d26812
No known key found for this signature in database
GPG key ID: 440BF8296E1C4AD9
2 changed files with 5 additions and 2 deletions

View file

@ -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<FileInputProps>(m => m.prototype?.activateUploadDialogue && m.prototype.setRef);
const FileInput = findComponentByFields<FileInputProps>("activateUploadDialogue", "setRef");
const TextAreaProps = findByProps("textarea");
const cl = classNameFactory("vc-settings-theme-");

View file

@ -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),