feat(web): unify attachment open behavior in context menus
Some checks failed
CI / test (push) Failing after 2m19s

This commit is contained in:
2026-03-08 22:24:28 +03:00
parent 4697193243
commit 751f8c9067
3 changed files with 23 additions and 5 deletions

View File

@@ -807,9 +807,20 @@ export function MessageList() {
{ctx.attachmentUrl ? (
<>
<div className="my-1 h-px bg-slate-700/80" />
<a className="block w-full rounded px-2 py-1.5 text-left text-sm hover:bg-slate-800" href={ctx.attachmentUrl} rel="noreferrer" target="_blank">
<button
className="block w-full rounded px-2 py-1.5 text-left text-sm hover:bg-slate-800"
onClick={() => {
const url = ctx.attachmentUrl;
if (!url) {
return;
}
window.open(url, "_blank", "noopener,noreferrer");
setCtx(null);
}}
type="button"
>
Open media
</a>
</button>
<button
className="block w-full rounded px-2 py-1.5 text-left text-sm hover:bg-slate-800"
onClick={async () => {