commit
650adb460d
@ -109,28 +109,20 @@ const ArticleBodyContent = (props) => {
|
||||
|
||||
path = getCategoryUrl(CategoryType.Personal);
|
||||
|
||||
if (activeItemId === myFolderId && folderId === selectedFolderId)
|
||||
return;
|
||||
|
||||
break;
|
||||
case archiveFolderId:
|
||||
const archiveFilter = RoomsFilter.getDefault(userId);
|
||||
archiveFilter.searchArea = RoomSearchArea.Archive;
|
||||
params = archiveFilter.toUrlParams(userId, true);
|
||||
path = getCategoryUrl(CategoryType.Archive);
|
||||
if (activeItemId === archiveFolderId && folderId === selectedFolderId)
|
||||
return;
|
||||
|
||||
break;
|
||||
case recycleBinFolderId:
|
||||
const recycleBinFilter = FilesFilter.getDefault();
|
||||
recycleBinFilter.folder = folderId;
|
||||
params = recycleBinFilter.toUrlParams();
|
||||
path = getCategoryUrl(CategoryType.Trash);
|
||||
if (
|
||||
activeItemId === recycleBinFolderId &&
|
||||
folderId === selectedFolderId
|
||||
)
|
||||
return;
|
||||
|
||||
break;
|
||||
case "accounts":
|
||||
const accountsFilter = AccountsFilter.getDefault();
|
||||
@ -138,7 +130,6 @@ const ArticleBodyContent = (props) => {
|
||||
path = getCategoryUrl(CategoryType.Accounts);
|
||||
|
||||
withTimer = false;
|
||||
if (activeItemId === "accounts" && isAccounts) return;
|
||||
|
||||
break;
|
||||
case "settings":
|
||||
@ -155,12 +146,11 @@ const ArticleBodyContent = (props) => {
|
||||
roomsFilter.searchArea = RoomSearchArea.Active;
|
||||
params = roomsFilter.toUrlParams(userId, true);
|
||||
path = getCategoryUrl(CategoryType.Shared);
|
||||
if (activeItemId === roomsFolderId && folderId === selectedFolderId)
|
||||
return;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
path += `?${params}`;
|
||||
path += `?${params}&date=${new Date().getTime()}`;
|
||||
|
||||
if (openingNewTab(path, e)) return;
|
||||
|
||||
|
@ -1397,6 +1397,13 @@ class FilesStore {
|
||||
return res;
|
||||
};
|
||||
|
||||
abortAllFetch = () => {
|
||||
this.filesController.abort();
|
||||
this.roomsController.abort();
|
||||
this.filesController = new AbortController();
|
||||
this.roomsController = new AbortController();
|
||||
};
|
||||
|
||||
fetchFiles = (
|
||||
folderId,
|
||||
filter,
|
||||
@ -1405,9 +1412,9 @@ class FilesStore {
|
||||
clearSelection = true,
|
||||
) => {
|
||||
const { setSelectedNode } = this.treeFoldersStore;
|
||||
|
||||
if (this.clientLoadingStore.isLoading) {
|
||||
this.roomsController.abort();
|
||||
this.roomsController = new AbortController();
|
||||
this.abortAllFetch();
|
||||
}
|
||||
|
||||
const filterData = filter ? filter.clone() : FilesFilter.getDefault();
|
||||
@ -1728,8 +1735,7 @@ class FilesStore {
|
||||
const { setSelectedNode, roomsFolderId } = this.treeFoldersStore;
|
||||
|
||||
if (this.clientLoadingStore.isLoading) {
|
||||
this.filesController.abort();
|
||||
this.filesController = new AbortController();
|
||||
this.abortAllFetch();
|
||||
}
|
||||
|
||||
const filterData = !!filter
|
||||
|
@ -47,6 +47,8 @@ class UsersStore {
|
||||
providers = [];
|
||||
accountsIsIsLoading = false;
|
||||
operationRunning = false;
|
||||
abortController = new AbortController();
|
||||
requestRunning = false;
|
||||
|
||||
constructor(peopleStore, settingsStore, infoPanelStore, userStore) {
|
||||
this.peopleStore = peopleStore;
|
||||
@ -63,6 +65,12 @@ class UsersStore {
|
||||
) => {
|
||||
const filterData = filter ? filter.clone() : Filter.getDefault();
|
||||
|
||||
if (this.requestRunning) {
|
||||
this.abortController.abort();
|
||||
|
||||
this.abortController = new AbortController();
|
||||
}
|
||||
|
||||
const filterStorageItem = localStorage.getItem(
|
||||
`PeopleFilter=${this.userStore.user?.id}`,
|
||||
);
|
||||
@ -88,9 +96,16 @@ class UsersStore {
|
||||
if (filterData.group && filterData.group === "root")
|
||||
filterData.group = undefined;
|
||||
|
||||
const res = await api.people.getUserList(filterData);
|
||||
this.requestRunning = true;
|
||||
|
||||
const res = await api.people.getUserList(
|
||||
filterData,
|
||||
this.abortController.signal,
|
||||
);
|
||||
filterData.total = res.total;
|
||||
|
||||
this.requestRunning = false;
|
||||
|
||||
if (updateFilter) {
|
||||
this.peopleStore.filterStore.setFilterParams(filterData);
|
||||
}
|
||||
|
@ -40,7 +40,10 @@ import { TReqOption } from "../../utils/axiosClient";
|
||||
import { EmployeeActivationStatus, ThemeKeys } from "../../enums";
|
||||
import { TGroup } from "../groups/types";
|
||||
|
||||
export async function getUserList(filter = Filter.getDefault()) {
|
||||
export async function getUserList(
|
||||
filter = Filter.getDefault(),
|
||||
signal?: AbortSignal,
|
||||
) {
|
||||
let params = "";
|
||||
// if (fake) {
|
||||
// return fakePeople.getUserList(filter);
|
||||
@ -57,6 +60,7 @@ export async function getUserList(filter = Filter.getDefault()) {
|
||||
const res = (await request({
|
||||
method: "get",
|
||||
url: `/people${params}`,
|
||||
signal,
|
||||
})) as TGetUserList;
|
||||
|
||||
res.items = res.items.map((user) => {
|
||||
|
Loading…
Reference in New Issue
Block a user