Skip to content

Commit

Permalink
ImageZoom: Fix incorrectly adding context menu in some places (#3150)
Browse files Browse the repository at this point in the history
  • Loading branch information
sadan4 authored Jan 25, 2025
1 parent 4036fba commit e19937d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/plugins/imageZoom/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 != null && [...props.target.classList].some(x => x === "emoji")) return;

const { square, nearestNeighbour } = settings.use(["square", "nearestNeighbour"]);

children.push(
Expand Down

0 comments on commit e19937d

Please sign in to comment.