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;
|
return body as Sticker;
|
||||||
}
|
}
|
||||||
|
|
||||||
function buildMenuItem(stickerId: string) {
|
function buildMenuItem(type: "Sticker", fetchData: () => Promisable<Omit<Sticker, "t">>) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Menu.MenuSeparator></Menu.MenuSeparator>
|
<Menu.MenuSeparator></Menu.MenuSeparator>
|
||||||
|
@ -103,13 +103,18 @@ function buildMenuItem(stickerId: string) {
|
||||||
const messageContextMenuPatch: NavContextMenuPatchCallback = (children, props) => {
|
const messageContextMenuPatch: NavContextMenuPatchCallback = (children, props) => {
|
||||||
const { favoriteableId, favoriteableType } = props ?? {};
|
const { favoriteableId, favoriteableType } = props ?? {};
|
||||||
if (!favoriteableId) return;
|
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 sticker = props.message.stickerItems.find(s => s.id === favoriteableId);
|
return buildMenuItem("Sticker", () => fetchSticker(favoriteableId));
|
||||||
if (sticker?.format_type === 3) return;
|
}
|
||||||
|
})();
|
||||||
|
|
||||||
const menuItem = buildMenuItem("Sticker", () => fetchSticker(favoriteableId);
|
if (menuItem)
|
||||||
findGroupChildrenByChildId("devmode-copy-id", children, true)?.push(menuItem);
|
findGroupChildrenByChildId("devmode-copy-id", children, true)?.push(menuItem);
|
||||||
};
|
};
|
||||||
|
|
||||||
const expressionPickerPatch: NavContextMenuPatchCallback = (children, props: { target: HTMLElement; }) => {
|
const expressionPickerPatch: NavContextMenuPatchCallback = (children, props: { target: HTMLElement; }) => {
|
||||||
|
|
Loading…
Add table
Reference in a new issue