Web:Client: fix click on back
This commit is contained in:
parent
2cbd3e05b8
commit
849ca096fd
@ -2136,7 +2136,7 @@ class FilesActionStore {
|
||||
};
|
||||
|
||||
onClickBack = () => {
|
||||
const { roomType } = this.selectedFolderStore;
|
||||
const { roomType, ...rest } = this.selectedFolderStore;
|
||||
const { setSelectedNode } = this.treeFoldersStore;
|
||||
const { clearFiles } = this.filesStore;
|
||||
|
||||
@ -2181,19 +2181,19 @@ class FilesActionStore {
|
||||
|
||||
setSelectedNode(["common"]);
|
||||
|
||||
return navigate(path, { replace: true });
|
||||
return window.DocSpace.navigate(path, { replace: true });
|
||||
}
|
||||
|
||||
if (categoryType === CategoryType.Accounts) {
|
||||
const accountsFilter = AccountsFilter.getDefault();
|
||||
params = accountsFilter.toUrlParams();
|
||||
const params = accountsFilter.toUrlParams();
|
||||
const path = getCategoryUrl(CategoryType.Accounts);
|
||||
|
||||
clearFiles();
|
||||
|
||||
setSelectedNode(["accounts", "filter"]);
|
||||
|
||||
return navigate(`${path}?${params}`, { replace: true });
|
||||
return window.DocSpace.navigate(`${path}?${params}`, { replace: true });
|
||||
}
|
||||
};
|
||||
|
||||
@ -2202,13 +2202,22 @@ class FilesActionStore {
|
||||
|
||||
const filter = RoomsFilter.getDefault();
|
||||
|
||||
const path = getCategoryUrl(categoryType);
|
||||
const correctCategoryType =
|
||||
categoryType === CategoryType.SharedRoom
|
||||
? CategoryType.Shared
|
||||
: CategoryType.ArchivedRoom === categoryType
|
||||
? CategoryType.Archive
|
||||
: categoryType;
|
||||
|
||||
const path = getCategoryUrl(correctCategoryType);
|
||||
|
||||
const state = {
|
||||
title:
|
||||
this.selectedFolderStore?.navigationPath[
|
||||
this.selectedFolderStore?.navigationPath.length - 1
|
||||
]?.title || "",
|
||||
(this.selectedFolderStore?.navigationPath &&
|
||||
this.selectedFolderStore?.navigationPath[
|
||||
this.selectedFolderStore?.navigationPath?.length - 1
|
||||
]?.title) ||
|
||||
"",
|
||||
isRoot: true,
|
||||
rootFolderType: this.selectedFolderStore.rootFolderType,
|
||||
};
|
||||
@ -2255,7 +2264,9 @@ class FilesActionStore {
|
||||
setIsSectionFilterLoading(param);
|
||||
};
|
||||
|
||||
let id = this.selectedFolderStore.parentId;
|
||||
const id = this.selectedFolderStore.parentId;
|
||||
|
||||
console.log(id);
|
||||
|
||||
const { navigationPath, rootFolderType } = this.selectedFolderStore;
|
||||
|
||||
@ -2263,16 +2274,19 @@ class FilesActionStore {
|
||||
|
||||
filter.folder = id;
|
||||
|
||||
const categoryType = getCategoryType(window.DocSpace.location);
|
||||
const path = getCategoryUrl(categoryType, id);
|
||||
|
||||
const state = {
|
||||
title: navigationPath[0]?.title || "",
|
||||
title: (navigationPath && navigationPath[0]?.title) || "",
|
||||
isRoot: navigationPath.length === 1,
|
||||
rootFolderType: rootFolderType,
|
||||
};
|
||||
|
||||
window.DocSpace.navigate(
|
||||
`${window.DocSpace.location.pathname}?${filter.toUrlParams()}`,
|
||||
{ state, replace: true }
|
||||
);
|
||||
window.DocSpace.navigate(`${path}?${filter.toUrlParams()}`, {
|
||||
state,
|
||||
replace: true,
|
||||
});
|
||||
};
|
||||
|
||||
setGroupMenuBlocked = (blocked) => {
|
||||
|
Loading…
Reference in New Issue
Block a user