fix: hide Open Original when sourceUrl is present to avoid redundancy

This commit is contained in:
Jannis Braun
2026-03-25 05:13:14 +01:00
parent e0d45da97c
commit f7fa7371d6
@@ -73,19 +73,21 @@ export function buildMessageMenuItems(params: MessageMenuParams): ContextMenuIte
copyImageToClipboard(imageUrl);
},
});
items.push({
key: 'open-original',
type: 'action',
label: 'Open Original',
icon: (
<svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor">
<path d="M19 19H5V5h7V3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z" />
</svg>
),
onClick: () => {
window.open(imageUrl, '_blank', 'noopener');
},
});
if (!sourceUrl) {
items.push({
key: 'open-original',
type: 'action',
label: 'Open Original',
icon: (
<svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor">
<path d="M19 19H5V5h7V3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z" />
</svg>
),
onClick: () => {
window.open(imageUrl, '_blank', 'noopener');
},
});
}
items.push({ key: 'image-sep', type: 'separator' });
}