im so tupid sometimes

This commit is contained in:
Elvyra 2025-01-16 14:20:24 +01:00
parent 9205b5d900
commit a62788c47b

View file

@ -32,7 +32,8 @@ import {
useRef, useRef,
UsernameUtils, UsernameUtils,
UserStore, UserStore,
useState useState,
useStateFromStores
} from "@webpack/common"; } from "@webpack/common";
import { Channel, Guild, User } from "discord-types/general"; import { Channel, Guild, User } from "discord-types/general";
@ -44,7 +45,6 @@ const TextTypes = findByPropsLazy("APPLICATION", "GROUP_DM", "GUILD");
const FrequencyModule = findByPropsLazy("getFrequentlyWithoutFetchingLatest"); const FrequencyModule = findByPropsLazy("getFrequentlyWithoutFetchingLatest");
const FrequentsModule = findByPropsLazy("getChannelHistory", "getFrequentGuilds"); const FrequentsModule = findByPropsLazy("getChannelHistory", "getFrequentGuilds");
const wrapperFn = findByCodeLazy("prevDeps:void 0,");
const convertItem = findByCodeLazy("GROUP_DM:return{", "GUILD_VOICE:case"); const convertItem = findByCodeLazy("GROUP_DM:return{", "GUILD_VOICE:case");
const loadFunction = findByCodeLazy(".frecencyWithoutFetchingLatest)"); const loadFunction = findByCodeLazy(".frecencyWithoutFetchingLatest)");
const SearchHandler = findByCodeLazy("createSearchContext", "setLimit"); const SearchHandler = findByCodeLazy("createSearchContext", "setLimit");
@ -494,7 +494,7 @@ export default function SearchModal({ modalProps, onSubmit, input, searchType =
loadFunction(); loadFunction();
const frequentChannels: Channel[] = wrapperFn([FrequencyModule], () => FrequencyModule.getFrequentlyWithoutFetchingLatest()); const frequentChannels: Channel[] = useStateFromStores([FrequencyModule], () => FrequencyModule.getFrequentlyWithoutFetchingLatest());
const hasQuery = query !== ""; const hasQuery = query !== "";
function getItem(e: DestinationItem): Result { function getItem(e: DestinationItem): Result {