mirror of
https://github.com/cloudreve/frontend.git
synced 2025-12-25 19:52:48 +00:00
fix(EntityRow&FileRow): close loading window after download starts
This commit is contained in:
parent
bb3a5f9908
commit
0a2a0df554
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue