fixed groups init loader not showing up

This commit is contained in:
namushka 2024-02-16 12:55:33 +03:00
parent f92072dad8
commit 23055d03c8
5 changed files with 20 additions and 4 deletions

View File

@ -77,7 +77,7 @@ const withLoader = (WrappedComponent) => (Loader) => {
showBodyLoader, showBodyLoader,
accountsViewAs, accountsViewAs,
}; };
} },
)(observer(withLoader)); )(observer(withLoader));
}; };
export default withLoader; export default withLoader;

View File

@ -7,7 +7,6 @@ import useViewEffect from "SRC_DIR/Hooks/useViewEffect";
import { Base } from "@docspace/shared/themes"; import { Base } from "@docspace/shared/themes";
import { TableContainer, TableBody } from "@docspace/shared/components/table"; import { TableContainer, TableBody } from "@docspace/shared/components/table";
import TableRow from "./TableRow"; import TableRow from "./TableRow";
import TableHeader from "./TableHeader"; import TableHeader from "./TableHeader";
import EmptyScreenGroups from "../../EmptyScreenGroups"; import EmptyScreenGroups from "../../EmptyScreenGroups";

View File

@ -20,6 +20,8 @@ class GroupsStore {
infoPanelStore; infoPanelStore;
clientLoadingStore;
groups = []; groups = [];
selection = []; selection = [];
@ -36,10 +38,16 @@ class GroupsStore {
insideGroupBackUrl: string | null = null; insideGroupBackUrl: string | null = null;
constructor(authStore: any, peopleStore: any, infoPanelStore: any) { constructor(
authStore: any,
peopleStore: any,
infoPanelStore: any,
clientLoadingStore: any,
) {
this.authStore = authStore; this.authStore = authStore;
this.peopleStore = peopleStore; this.peopleStore = peopleStore;
this.infoPanelStore = infoPanelStore; this.infoPanelStore = infoPanelStore;
this.clientLoadingStore = clientLoadingStore;
makeAutoObservable(this); makeAutoObservable(this);
} }
@ -151,6 +159,7 @@ class GroupsStore {
updateFilter = false, updateFilter = false,
withFilterLocalStorage = false, withFilterLocalStorage = false,
) => { ) => {
this.clientLoadingStore.setIsSectionBodyLoading(true);
const filterData = filter ? filter.clone() : Filter.getDefault(); const filterData = filter ? filter.clone() : Filter.getDefault();
const filterStorageItem = localStorage.getItem( const filterStorageItem = localStorage.getItem(
@ -169,6 +178,7 @@ class GroupsStore {
if (updateFilter) this.setFilterParams(filterData); if (updateFilter) this.setFilterParams(filterData);
this.clientLoadingStore.setIsSectionBodyLoading(false);
this.groups = res.items || []; this.groups = res.items || [];
}; };

View File

@ -63,6 +63,7 @@ class PeopleStore {
userStore, userStore,
tfaStore, tfaStore,
settingsStore, settingsStore,
clientLoadingStore,
) { ) {
this.authStore = authStore; this.authStore = authStore;
this.infoPanelStore = infoPanelStore; this.infoPanelStore = infoPanelStore;
@ -72,7 +73,12 @@ class PeopleStore {
infoPanelStore, infoPanelStore,
userStore, userStore,
); );
this.groupsStore = new GroupsStore(authStore, this, infoPanelStore); this.groupsStore = new GroupsStore(
authStore,
this,
infoPanelStore,
clientLoadingStore,
);
this.targetUserStore = new TargetUserStore(this, userStore); this.targetUserStore = new TargetUserStore(this, userStore);
this.selectedGroupStore = new SelectedGroupStore(this); this.selectedGroupStore = new SelectedGroupStore(this);
this.editingFormStore = new EditingFormStore(this); this.editingFormStore = new EditingFormStore(this);

View File

@ -147,6 +147,7 @@ const peopleStore = new PeopleStore(
userStore, userStore,
tfaStore, tfaStore,
settingsStore, settingsStore,
clientLoadingStore,
); );
const uploadDataStore = new UploadDataStore( const uploadDataStore = new UploadDataStore(