Fixed bug 57697 - Web: Files: added delay for requesting a folder if is viewer mode

This commit is contained in:
Dmitry Sychugov 2022-06-27 13:54:45 +05:00
parent 5df5469005
commit 9ec801e233

View File

@ -67,16 +67,18 @@ class PureHome extends React.Component {
const pathname = window.location.href;
const fileId = pathname.slice(pathname.indexOf("#preview") + 9);
getFileInfo(fileId)
.then((data) => {
const canOpenPlayer = isMediaOrImage(data.fileExst);
const file = { ...data, canOpenPlayer };
setToPreviewFile(file, true);
})
.catch((err) => {
toastr.error(err);
this.fetchDefaultFiles();
});
setTimeout(() => {
getFileInfo(fileId)
.then((data) => {
const canOpenPlayer = isMediaOrImage(data.fileExst);
const file = { ...data, canOpenPlayer };
setToPreviewFile(file, true);
})
.catch((err) => {
toastr.error(err);
this.fetchDefaultFiles();
});
}, 1);
return;
}