mirror of
https://github.com/Vendicated/Vencord.git
synced 2025-02-24 15:35:11 +00:00
revert changes that broke the code
This commit is contained in:
parent
bb3f8bd20a
commit
0f61bca0c5
1 changed files with 11 additions and 6 deletions
|
@ -61,7 +61,7 @@ async function fetchSticker(id: string) {
|
|||
return body as Sticker;
|
||||
}
|
||||
|
||||
function buildMenuItem(stickerId: string) {
|
||||
function buildMenuItem(type: "Sticker", fetchData: () => Promisable<Omit<Sticker, "t">>) {
|
||||
return (
|
||||
<>
|
||||
<Menu.MenuSeparator></Menu.MenuSeparator>
|
||||
|
@ -103,12 +103,17 @@ function buildMenuItem(stickerId: string) {
|
|||
const messageContextMenuPatch: NavContextMenuPatchCallback = (children, props) => {
|
||||
const { favoriteableId, favoriteableType } = props ?? {};
|
||||
if (!favoriteableId) return;
|
||||
if (favoriteableType != "sticker") return;
|
||||
|
||||
const menuItem = (() => {
|
||||
switch (favoriteableType) {
|
||||
case "sticker":
|
||||
const sticker = props.message.stickerItems.find(s => s.id === favoriteableId);
|
||||
if (sticker?.format_type === 3) return;
|
||||
|
||||
const menuItem = buildMenuItem("Sticker", () => fetchSticker(favoriteableId);
|
||||
return buildMenuItem("Sticker", () => fetchSticker(favoriteableId));
|
||||
}
|
||||
})();
|
||||
|
||||
if (menuItem)
|
||||
findGroupChildrenByChildId("devmode-copy-id", children, true)?.push(menuItem);
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue