mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-19 03:17:02 -04:00
Make Context Menu API support hooks (#902)
Co-authored-by: V <vendicated@riseup.net>
This commit is contained in:
parent
e8809fc57b
commit
96f640da67
10 changed files with 29 additions and 24 deletions
|
@ -210,7 +210,7 @@ function isGifUrl(url: string) {
|
|||
return new URL(url).pathname.endsWith(".gif");
|
||||
}
|
||||
|
||||
const messageContextMenuPatch: NavContextMenuPatchCallback = (children, props) => {
|
||||
const messageContextMenuPatch: NavContextMenuPatchCallback = (children, props) => () => {
|
||||
const { favoriteableId, itemHref, itemSrc, favoriteableType } = props ?? {};
|
||||
|
||||
if (!favoriteableId || favoriteableType !== "emoji") return;
|
||||
|
@ -223,7 +223,7 @@ const messageContextMenuPatch: NavContextMenuPatchCallback = (children, props) =
|
|||
if (group) group.push(buildMenuItem(favoriteableId, name, isGifUrl(itemHref ?? itemSrc)));
|
||||
};
|
||||
|
||||
const expressionPickerPatch: NavContextMenuPatchCallback = (children, props: { target: HTMLElement; }) => {
|
||||
const expressionPickerPatch: NavContextMenuPatchCallback = (children, props: { target: HTMLElement; }) => () => {
|
||||
const { id, name, type } = props?.target?.dataset ?? {};
|
||||
if (!id || !name || type !== "emoji") return;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue