ExpressionCloner: fix clone modal being blank (#4495)
This commit is contained in:
parent
4af36e5723
commit
c68c4668dc
1 changed files with 8 additions and 3 deletions
|
|
@ -22,7 +22,7 @@ import { BaseText } from "@components/BaseText";
|
|||
import { CheckedTextInput } from "@components/CheckedTextInput";
|
||||
import { Flex } from "@components/Flex";
|
||||
import { Devs } from "@utils/constants";
|
||||
import { getGuildAcronym } from "@utils/discord";
|
||||
import { getGuildAcronym, hasGuildFeature } from "@utils/discord";
|
||||
import { Logger } from "@utils/Logger";
|
||||
import definePlugin from "@utils/types";
|
||||
import { Guild, GuildSticker } from "@vencord/discord-types";
|
||||
|
|
@ -33,8 +33,6 @@ import { Promisable } from "type-fest";
|
|||
|
||||
const uploadEmoji = findByCodeLazy(".GUILD_EMOJIS(", "EMOJI_UPLOAD_START");
|
||||
|
||||
const getGuildMaxEmojiSlots = findByCodeLazy(".additionalEmojiSlots") as (guild: Guild) => number;
|
||||
|
||||
interface Sticker extends GuildSticker {
|
||||
t: "Sticker";
|
||||
}
|
||||
|
|
@ -72,6 +70,13 @@ function getGuildMaxStickerSlots(guild: Guild) {
|
|||
return PremiumTierStickerLimitMap[guild.premiumTier] ?? PremiumTierStickerLimitMap[0];
|
||||
}
|
||||
|
||||
function getGuildMaxEmojiSlots(guild: Guild) {
|
||||
return Math.max(
|
||||
hasGuildFeature(guild, "MORE_EMOJI") ? 200 : 50,
|
||||
50 + (guild.premiumFeatures?.additionalEmojiSlots ?? 0)
|
||||
);
|
||||
}
|
||||
|
||||
function getUrl(data: Data, size: number) {
|
||||
if (data.t === "Emoji")
|
||||
return `${location.protocol}//${window.GLOBAL_ENV.CDN_HOST}/emojis/${data.id}.webp?size=${size}&lossless=true&animated=true`;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue