Fix FavoriteGifSearch & broken Menu component find
This commit is contained in:
parent
4e8d22b4d5
commit
50eb62045a
2 changed files with 2 additions and 8 deletions
|
|
@ -20,13 +20,11 @@ import { definePluginSettings } from "@api/Settings";
|
||||||
import ErrorBoundary from "@components/ErrorBoundary";
|
import ErrorBoundary from "@components/ErrorBoundary";
|
||||||
import { Devs } from "@utils/constants";
|
import { Devs } from "@utils/constants";
|
||||||
import definePlugin, { OptionType } from "@utils/types";
|
import definePlugin, { OptionType } from "@utils/types";
|
||||||
import { findByPropsLazy } from "@webpack";
|
|
||||||
import { useCallback, useEffect, useRef, useState } from "@webpack/common";
|
import { useCallback, useEffect, useRef, useState } from "@webpack/common";
|
||||||
|
|
||||||
interface SearchBarComponentProps {
|
interface SearchBarComponentProps {
|
||||||
ref?: React.MutableRefObject<any>;
|
ref?: React.RefObject<any>;
|
||||||
autoFocus: boolean;
|
autoFocus: boolean;
|
||||||
className: string;
|
|
||||||
size: string;
|
size: string;
|
||||||
onChange: (query: string) => void;
|
onChange: (query: string) => void;
|
||||||
onClear: () => void;
|
onClear: () => void;
|
||||||
|
|
@ -59,9 +57,6 @@ interface Instance {
|
||||||
forceUpdate: () => void;
|
forceUpdate: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const containerClasses: { searchBar: string; } = findByPropsLazy("searchBar", "searchBarFullRow");
|
|
||||||
|
|
||||||
export const settings = definePluginSettings({
|
export const settings = definePluginSettings({
|
||||||
searchOption: {
|
searchOption: {
|
||||||
type: OptionType.SELECT,
|
type: OptionType.SELECT,
|
||||||
|
|
@ -181,7 +176,6 @@ function SearchBar({ instance, SearchBarComponent }: { instance: Instance; Searc
|
||||||
<SearchBarComponent
|
<SearchBarComponent
|
||||||
ref={ref}
|
ref={ref}
|
||||||
autoFocus={true}
|
autoFocus={true}
|
||||||
className={containerClasses.searchBar}
|
|
||||||
size="md"
|
size="md"
|
||||||
onChange={onChange}
|
onChange={onChange}
|
||||||
onClear={() => {
|
onClear={() => {
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ waitFor(m => m.name === "MenuCheckboxItem", (_, id) => {
|
||||||
|
|
||||||
waitFor(filters.componentByCode('path:["empty"]'), m => Menu.Menu = m);
|
waitFor(filters.componentByCode('path:["empty"]'), m => Menu.Menu = m);
|
||||||
waitFor(filters.componentByCode("sliderContainer", "slider", "handleSize:16", "=100"), m => Menu.MenuSliderControl = m);
|
waitFor(filters.componentByCode("sliderContainer", "slider", "handleSize:16", "=100"), m => Menu.MenuSliderControl = m);
|
||||||
waitFor(filters.componentByCode('role:"searchbox', "top:2", "query:"), m => Menu.MenuSearchControl = m);
|
waitFor(filters.componentByCode(".SEARCH)", ".focus()", "query:"), m => Menu.MenuSearchControl = m);
|
||||||
|
|
||||||
export const ContextMenuApi: t.ContextMenuApi = mapMangledModuleLazy('type:"CONTEXT_MENU_OPEN', {
|
export const ContextMenuApi: t.ContextMenuApi = mapMangledModuleLazy('type:"CONTEXT_MENU_OPEN', {
|
||||||
closeContextMenu: filters.byCode("CONTEXT_MENU_CLOSE"),
|
closeContextMenu: filters.byCode("CONTEXT_MENU_CLOSE"),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue