mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-19 03:17:02 -04:00
Option to transform emotes/stickers in compound messages (#876)
+ ContextMenu refactor to not call callbacks for same children multiple times Co-authored-by: V <vendicated@riseup.net>
This commit is contained in:
parent
cfe41ef656
commit
e34da54271
9 changed files with 69 additions and 112 deletions
|
@ -220,8 +220,7 @@ const messageContextMenuPatch: NavContextMenuPatchCallback = (children, props) =
|
|||
const name = match[1] ?? "FakeNitroEmoji";
|
||||
|
||||
const group = findGroupChildrenByChildId("copy-link", children);
|
||||
if (group && !group.some(child => child?.props?.id === "emote-cloner"))
|
||||
group.push(buildMenuItem(favoriteableId, name, isGifUrl(itemHref ?? itemSrc)));
|
||||
if (group) group.push(buildMenuItem(favoriteableId, name, isGifUrl(itemHref ?? itemSrc)));
|
||||
};
|
||||
|
||||
const expressionPickerPatch: NavContextMenuPatchCallback = (children, props: { target: HTMLElement; }) => {
|
||||
|
@ -230,8 +229,7 @@ const expressionPickerPatch: NavContextMenuPatchCallback = (children, props: { t
|
|||
|
||||
const firstChild = props.target.firstChild as HTMLImageElement;
|
||||
|
||||
if (!children.some(c => c?.props?.id === "emote-cloner"))
|
||||
children.push(buildMenuItem(id, name, firstChild && isGifUrl(firstChild.src)));
|
||||
children.push(buildMenuItem(id, name, firstChild && isGifUrl(firstChild.src)));
|
||||
};
|
||||
|
||||
export default definePlugin({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue