Skip to content

Commit

Permalink
Prevent new tab on download via preview modal
Browse files Browse the repository at this point in the history
  • Loading branch information
edmondsgarrett committed Nov 14, 2023
1 parent 5e6be96 commit 15a95ee
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const DataFilesPreviewModal = () => {
const { href, content, error, fileType, isLoading } = useSelector(
(state) => state.files.preview
);
console.log(useSelector(state => state.files.preview))
const hasError = error !== null;
const previewUsingTextContent = !isLoading && !hasError && content !== null;
const previewUsingHref = !isLoading && !hasError && !previewUsingTextContent;
Expand Down Expand Up @@ -116,7 +117,7 @@ const DataFilesPreviewModal = () => {
<SectionMessage type="warning" className={styles['error-message']}>
{error}
</SectionMessage>
<Button className={styles.button} href={href} target="_blank">
<Button className={styles.button} href={href} target={fileType === 'other' ? "" : "_blank"}>
<i className="icon-exit" />
<span className="toolbar-button-text">Preview File</span>
</Button>
Expand Down

0 comments on commit 15a95ee

Please sign in to comment.