MediaViewer: Fixed navigate

This commit is contained in:
Akmal Isomadinov 2024-02-01 16:37:42 +05:00
parent b3558f0f66
commit 0fef451f28
2 changed files with 9 additions and 2 deletions

View File

@ -95,7 +95,8 @@ const useFiles = ({
};
React.useEffect(() => {
if (isAccountsPage || isSettingsPage) return;
if (isAccountsPage || isSettingsPage || location.state?.fromMediaViewer)
return;
if (location.pathname === "/") setIsLoading(true, true, true);
else setIsLoading(true, false, false);

View File

@ -205,7 +205,13 @@ const FilesMediaViewer = (props) => {
setScrollToItem({ id: targetFile.id, type: "file" });
}
window.history.replaceState(null, "", url);
navigate(url, {
replace: true,
state: {
...location.state,
fromMediaViewer: true,
},
});
},
[
files,