mirror of
https://github.com/stoatchat/for-legacy-web.git
synced 2026-03-07 09:25:27 +00:00
fix: don't open new tab to download attachment (#614)
This commit is contained in:
@@ -4,6 +4,7 @@ import {
|
||||
Download,
|
||||
} from "@styled-icons/boxicons-regular";
|
||||
import { File, Video } from "@styled-icons/boxicons-solid";
|
||||
import { isFirefox } from "react-device-detect";
|
||||
import { API } from "revolt.js";
|
||||
|
||||
import styles from "./AttachmentActions.module.scss";
|
||||
@@ -51,7 +52,7 @@ export default function AttachmentActions({ attachment }: Props) {
|
||||
href={download_url}
|
||||
className={styles.downloadIcon}
|
||||
download
|
||||
target="_blank"
|
||||
target={isFirefox ? "_blank" : "_self"}
|
||||
rel="noreferrer">
|
||||
<IconButton>
|
||||
<Download size={24} />
|
||||
@@ -69,7 +70,7 @@ export default function AttachmentActions({ attachment }: Props) {
|
||||
href={download_url}
|
||||
className={styles.downloadIcon}
|
||||
download
|
||||
target="_blank"
|
||||
target={isFirefox ? "_blank" : "_self"}
|
||||
rel="noreferrer">
|
||||
<IconButton>
|
||||
<Download size={24} />
|
||||
@@ -89,7 +90,7 @@ export default function AttachmentActions({ attachment }: Props) {
|
||||
href={download_url}
|
||||
className={styles.downloadIcon}
|
||||
download
|
||||
target="_blank"
|
||||
target={isFirefox ? "_blank" : "_self"}
|
||||
rel="noreferrer">
|
||||
<IconButton>
|
||||
<Download size={24} />
|
||||
@@ -118,7 +119,7 @@ export default function AttachmentActions({ attachment }: Props) {
|
||||
href={download_url}
|
||||
className={styles.downloadIcon}
|
||||
download
|
||||
target="_blank"
|
||||
target={isFirefox ? "_blank" : "_self"}
|
||||
rel="noreferrer">
|
||||
<IconButton>
|
||||
<Download size={24} />
|
||||
|
||||
Reference in New Issue
Block a user