diff --git a/src/component/Admin/Entity/EntityRow.tsx b/src/component/Admin/Entity/EntityRow.tsx index 94867c1..ad9594a 100644 --- a/src/component/Admin/Entity/EntityRow.tsx +++ b/src/component/Admin/Entity/EntityRow.tsx @@ -51,7 +51,12 @@ const EntityRow = ({ setOpenLoading(true); dispatch(getEntityUrl(entity?.id ?? 0)) .then((url) => { - entityLink ? (entityLink.location.href = url) : window.open(url, "_blank"); + if (entityLink) { + entityLink.close(); + window.open(url, "_blank"); + } else { + window.open(url, "_blank"); + } }) .finally(() => { setOpenLoading(false); diff --git a/src/component/Admin/File/FileRow.tsx b/src/component/Admin/File/FileRow.tsx index 3c1f56c..90d6116 100644 --- a/src/component/Admin/File/FileRow.tsx +++ b/src/component/Admin/File/FileRow.tsx @@ -72,7 +72,12 @@ const FileRow = ({ fileLink?.document.write("Loading file URL..."); dispatch(getFileUrl(file?.id ?? 0)) .then((url) => { - fileLink ? (fileLink.location.href = url) : window.open(url, "_blank"); + if (fileLink) { + fileLink.close(); + window.open(url, "_blank"); + } else { + window.open(url, "_blank"); + } }) .finally(() => { setOpenLoading(false);