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

@@ -987,9 +987,16 @@ export function ChatInfoPanel({ chatId, open, onClose }: Props) {
style={{ left: attachmentCtx.x, top: attachmentCtx.y }}
onClick={(event) => event.stopPropagation()}
>
<a className="block rounded px-2 py-1.5 text-sm hover:bg-slate-800" href={attachmentCtx.url} rel="noreferrer" target="_blank">
<button
className="block w-full rounded px-2 py-1.5 text-left text-sm hover:bg-slate-800"
onClick={() => {
window.open(attachmentCtx.url, "_blank", "noopener,noreferrer");
setAttachmentCtx(null);
}}
type="button"
>
Open
</a>
</button>
<button
className="block w-full rounded px-2 py-1.5 text-left text-sm hover:bg-slate-800"
onClick={async () => {