mirror of
https://github.com/Vendicated/Vencord.git
synced 2025-02-24 07:25:10 +00:00
fix: sticker prompt would show up everywhere
This commit is contained in:
parent
d57e479985
commit
4641ef5de9
1 changed files with 5 additions and 6 deletions
|
@ -28,12 +28,8 @@ const StickersStore = findStoreLazy("StickersStore");
|
|||
|
||||
interface Sticker {
|
||||
t: "Sticker";
|
||||
description: string;
|
||||
format_type: number;
|
||||
guild_id: string;
|
||||
id: string;
|
||||
name: string;
|
||||
tags: string;
|
||||
type: number;
|
||||
}
|
||||
|
||||
|
@ -97,12 +93,15 @@ function buildMenuItem(Sticker, fetchData: () => Promisable<Omit<Sticker, "t">>)
|
|||
}
|
||||
|
||||
const messageContextMenuPatch: NavContextMenuPatchCallback = (children, props) => {
|
||||
const { favoriteableId } = props ?? {};
|
||||
const { favoriteableId, favoriteableType } = props ?? {};
|
||||
if (!favoriteableId) return;
|
||||
const menuItem = (() => {
|
||||
const sticker = props.message.stickerItems.find(s => s.id === favoriteableId);
|
||||
if (sticker?.format_type === 3) return;
|
||||
return buildMenuItem("Sticker", () => fetchSticker(favoriteableId));
|
||||
switch (favoriteableType) {
|
||||
case "sticker":
|
||||
return buildMenuItem("Sticker", () => fetchSticker(favoriteableId));
|
||||
}
|
||||
})();
|
||||
|
||||
if (menuItem)
|
||||
|
|
Loading…
Add table
Reference in a new issue