From aac5242dc8e4cbac6a7fc99a084707b973eabfbc Mon Sep 17 00:00:00 2001 From: sadan4 <117494111+sadan4@users.noreply.github.com> Date: Fri, 24 Jan 2025 19:11:26 -0500 Subject: [PATCH] ImageZoom: Fix incorrectly adding context menu in some places (#3150) --- src/plugins/imageZoom/index.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/plugins/imageZoom/index.tsx b/src/plugins/imageZoom/index.tsx index 06e1dcd55..8c50ae9f4 100644 --- a/src/plugins/imageZoom/index.tsx +++ b/src/plugins/imageZoom/index.tsx @@ -81,7 +81,12 @@ export const settings = definePluginSettings({ }); -const imageContextMenuPatch: NavContextMenuPatchCallback = children => { +const imageContextMenuPatch: NavContextMenuPatchCallback = (children, props) => { + // Discord re-uses the image context menu for links to for the copy and open buttons + if ("href" in props) return; + // emojis in user statuses + if (props.target?.classList?.contains("emoji")) return; + const { square, nearestNeighbour } = settings.use(["square", "nearestNeighbour"]); children.push(