WEb: Editor: Deleted redirect to a new tab before downloading.

This commit is contained in:
Tatiana Lopaeva 2021-08-06 14:10:55 +03:00
parent 9230d4c62d
commit 45b3b462de

View File

@ -131,13 +131,12 @@ export default function withContextOptions(WrappedComponent) {
openDocEditor(id, providerKey, tab);
};
onClickDownload = () => {
const { item, downloadAction, t } = this.props;
const { fileExst, contentLength, viewUrl } = item;
const isFile = !!fileExst && contentLength;
isFile
? window.open(viewUrl, "_blank")
? window.open(viewUrl, "_self")
: downloadAction(t("Translations:ArchivingData")).catch((err) =>
toastr.error(err)
);