Fetch all findstorelazy from webpack

This commit is contained in:
thororen1234 2024-07-20 03:55:47 -04:00
parent 6714da52f0
commit bf246208e9
30 changed files with 156 additions and 241 deletions

View file

@ -23,11 +23,9 @@ import { Logger } from "@utils/Logger";
import { Margins } from "@utils/margins";
import { ModalContent, ModalHeader, ModalRoot, openModalLazy } from "@utils/modal";
import definePlugin from "@utils/types";
import { findByCodeLazy, findStoreLazy } from "@webpack";
import { Constants, EmojiStore, FluxDispatcher, Forms, GuildStore, Menu, PermissionsBits, PermissionStore, React, RestAPI, Toasts, Tooltip, UserStore } from "@webpack/common";
import { findByCodeLazy } from "@webpack";
import { Constants, EmojiStore, FluxDispatcher, Forms, GuildStore, Menu, PermissionsBits, PermissionStore, React, RestAPI, StickerStore, Toasts, Tooltip, UserStore } from "@webpack/common";
import { Promisable } from "type-fest";
const StickersStore = findStoreLazy("StickersStore");
const uploadEmoji = findByCodeLazy(".GUILD_EMOJIS(", "EMOJI_UPLOAD_START");
interface Sticker {
@ -60,7 +58,7 @@ function getUrl(data: Data) {
}
async function fetchSticker(id: string) {
const cached = StickersStore.getStickerById(id);
const cached = StickerStore.getStickerById(id);
if (cached) return cached;
const { body } = await RestAPI.get({