mirror of
https://github.com/Vendicated/Vencord.git
synced 2025-02-24 15:35:11 +00:00
Actually works now, nice.
This commit is contained in:
parent
dc0aef360b
commit
2c47b13fe4
1 changed files with 38 additions and 33 deletions
|
@ -72,44 +72,49 @@ async function fetchSticker(id: string) {
|
|||
|
||||
function buildMenuItem(type: "Sticker", fetchData: () => Promisable<Omit<Sticker, "t">>) {
|
||||
return (
|
||||
<Menu.MenuItem
|
||||
id="copystickerurl"
|
||||
key="copystickerurl"
|
||||
label={"Copy Sticker Link"}
|
||||
action={async () => {
|
||||
const res = await fetchData();
|
||||
const data = { t: type, ...res } as Sticker;
|
||||
const url = getUrl(data);
|
||||
console.log("URL: " + url + "\n" + "Data: " + data);
|
||||
Toasts.show({
|
||||
message: "Link to sticker copied!",
|
||||
type: Toasts.Type.SUCCESS,
|
||||
id: Toasts.genId()
|
||||
});
|
||||
Clipboard.copy(url);
|
||||
}
|
||||
}
|
||||
/>
|
||||
<>
|
||||
<Menu.MenuSeparator></Menu.MenuSeparator>
|
||||
|
||||
<Menu.MenuItem
|
||||
id="copystickerurl"
|
||||
key="copystickerurl"
|
||||
label={"Copy Sticker Link"}
|
||||
action={async () => {
|
||||
const res = await fetchData();
|
||||
const data = { t: type, ...res } as Sticker;
|
||||
const url = getUrl(data);
|
||||
console.log("URL: " + url + "\n" + "Data: " + data);
|
||||
Toasts.show({
|
||||
message: "Link to sticker copied!",
|
||||
type: Toasts.Type.SUCCESS,
|
||||
id: Toasts.genId()
|
||||
});
|
||||
Clipboard.copy(url);
|
||||
}
|
||||
}
|
||||
/>
|
||||
|
||||
<Menu.MenuItem
|
||||
id="openstickerlink"
|
||||
key="openstickerlink"
|
||||
label={"Open Sticker Link"}
|
||||
action={async () => {
|
||||
const res = await fetchData();
|
||||
const data = { t: type, ...res } as Sticker;
|
||||
const url = getUrl(data);
|
||||
VencordNative.native.openExternal(url);
|
||||
}
|
||||
}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
/*
|
||||
<Menu.MenuItem
|
||||
id="openstickerlink"
|
||||
key="openstickerlink"
|
||||
label={"Open Sticker Link"}
|
||||
action={async () => {
|
||||
const res = await fetchData();
|
||||
const data = { t: type, ...res } as Sticker;
|
||||
const url = getUrl(data);
|
||||
VencordNative.native.openExternal(url);
|
||||
}
|
||||
}
|
||||
/>
|
||||
*/
|
||||
|
||||
|
||||
|
||||
const messageContextMenuPatch: NavContextMenuPatchCallback = (children, props) => {
|
||||
const { favoriteableId, itemHref, itemSrc, favoriteableType } = props ?? {};
|
||||
const { favoriteableId, favoriteableType } = props ?? {};
|
||||
if (!favoriteableId) return;
|
||||
const menuItem = (() => {
|
||||
switch (favoriteableType) {
|
||||
|
|
Loading…
Add table
Reference in a new issue