Web:Client: refactoring

This commit is contained in:
Timofey Boyko 2023-06-05 17:02:40 +03:00
parent d207fd7c60
commit 808f007ba0
11 changed files with 15 additions and 49 deletions

View File

@ -269,13 +269,12 @@ export default inject(
const { clearFiles } = filesStore;
const {
showArticleLoader,
setIsSectionBodyLoading,
setIsSectionFilterLoading,
firstLoad,
} = clientLoadingStore;
const setIsLoading = (param, withTimer) => {
setIsSectionBodyLoading(param, withTimer);
setIsSectionFilterLoading(param, withTimer);
};

View File

@ -236,11 +236,9 @@ export default inject(
const { onClickInviteUsers } = contextOptionsStore;
const { setIsSectionBodyLoading, setIsSectionFilterLoading, isLoading } =
clientLoadingStore;
const { setIsSectionFilterLoading, isLoading } = clientLoadingStore;
const setIsLoading = (param) => {
setIsSectionBodyLoading(param);
setIsSectionFilterLoading(param);
};

View File

@ -82,11 +82,9 @@ const RoomNoAccessContainer = (props) => {
};
export default inject(({ auth, filesStore, clientLoadingStore }) => {
const { setIsSectionBodyLoading, setIsSectionFilterLoading } =
clientLoadingStore;
const { setIsSectionFilterLoading } = clientLoadingStore;
const setIsLoading = (param) => {
setIsSectionBodyLoading(param);
setIsSectionFilterLoading(param);
};
const { isEmptyPage } = filesStore;

View File

@ -376,11 +376,9 @@ export default inject(
const { isDesktopClient, isEncryptionSupport, organizationName, theme } =
auth.settingsStore;
const { setIsSectionBodyLoading, setIsSectionFilterLoading } =
clientLoadingStore;
const { setIsSectionFilterLoading } = clientLoadingStore;
const setIsLoading = (param) => {
setIsSectionBodyLoading(param);
setIsSectionFilterLoading(param);
};

View File

@ -303,8 +303,7 @@ export default inject(
settingsStore,
clientLoadingStore,
}) => {
const { setIsSectionBodyLoading, setIsSectionFilterLoading } =
clientLoadingStore;
const { setIsSectionBodyLoading } = clientLoadingStore;
const setIsLoading = (param) => {
setIsSectionBodyLoading(param);

View File

@ -368,11 +368,9 @@ export default inject(
refreshFiles,
} = filesStore;
const { setIsSectionBodyLoading, setIsSectionFilterLoading, isLoading } =
clientLoadingStore;
const { setIsSectionFilterLoading, isLoading } = clientLoadingStore;
const setIsLoading = (param) => {
setIsSectionBodyLoading(param);
setIsSectionFilterLoading(param);
};

View File

@ -241,12 +241,10 @@ export default inject(
const {
firstLoad,
setIsSectionBodyLoading,
setIsSectionFilterLoading,
} = clientLoadingStore;
const setIsLoading = (param) => {
setIsSectionBodyLoading(param);
setIsSectionFilterLoading(param);
};

View File

@ -959,15 +959,10 @@ export default inject(
clearFiles,
} = filesStore;
const {
setIsSectionBodyLoading,
setIsSectionFilterLoading,
showHeaderLoader,
isLoading,
} = clientLoadingStore;
const { setIsSectionFilterLoading, showHeaderLoader, isLoading } =
clientLoadingStore;
const setIsLoading = (param) => {
setIsSectionBodyLoading(param);
setIsSectionFilterLoading(param);
};

View File

@ -313,7 +313,6 @@ export default inject(
selectedFolderStore,
clientLoadingStore,
}) => {
const { setSelectedFolder } = selectedFolderStore;
const {
secondaryProgressDataStore,
primaryProgressDataStore,
@ -323,7 +322,6 @@ export default inject(
const {
firstLoad,
setIsSectionBodyLoading,
setIsSectionFilterLoading,
isLoading,
@ -331,7 +329,6 @@ export default inject(
} = clientLoadingStore;
const setIsLoading = (param) => {
setIsSectionBodyLoading(param);
setIsSectionFilterLoading(param);
};

View File

@ -162,12 +162,10 @@ class CreateEditRoomStore {
};
onOpenNewRoom = async (room) => {
const { setIsSectionBodyLoading, setIsSectionFilterLoading } =
this.clientLoadingStore;
const { setIsSectionFilterLoading } = this.clientLoadingStore;
const { setView, setIsVisible } = this.infoPanelStore;
const setIsLoading = (param) => {
setIsSectionBodyLoading(param);
setIsSectionFilterLoading(param);
};

View File

@ -1282,11 +1282,9 @@ class FilesActionStore {
openLocationAction = async (item) => {
this.filesStore.setBufferSelection(null);
const { setIsSectionBodyLoading, setIsSectionFilterLoading } =
this.clientLoadingStore;
const { setIsSectionFilterLoading } = this.clientLoadingStore;
const setIsLoading = (param) => {
setIsSectionBodyLoading(param);
setIsSectionFilterLoading(param);
};
@ -1308,11 +1306,9 @@ class FilesActionStore {
const { myRoomsId, myFolderId, archiveRoomsId, recycleBinFolderId } =
this.treeFoldersStore;
const { rootFolderType } = this.selectedFolderStore;
const { setIsSectionBodyLoading, setIsSectionFilterLoading } =
this.clientLoadingStore;
const { setIsSectionFilterLoading } = this.clientLoadingStore;
const setIsLoading = (param) => {
setIsSectionBodyLoading(param);
setIsSectionFilterLoading(param);
};
@ -2015,11 +2011,9 @@ class FilesActionStore {
const { setMediaViewerData } = this.mediaViewerDataStore;
const { setConvertDialogVisible, setConvertItem } = this.dialogsStore;
const { setIsSectionBodyLoading, setIsSectionFilterLoading } =
this.clientLoadingStore;
const { setIsSectionFilterLoading } = this.clientLoadingStore;
const setIsLoading = (param) => {
setIsSectionBodyLoading(param);
setIsSectionFilterLoading(param);
};
@ -2098,11 +2092,9 @@ class FilesActionStore {
const { setSelectedNode } = this.treeFoldersStore;
const { clearFiles } = this.filesStore;
const { setIsSectionBodyLoading, setIsSectionFilterLoading } =
this.clientLoadingStore;
const { setIsSectionFilterLoading } = this.clientLoadingStore;
const setIsLoading = (param) => {
setIsSectionBodyLoading(param);
setIsSectionFilterLoading(param);
};
@ -2160,11 +2152,9 @@ class FilesActionStore {
};
moveToRoomsPage = () => {
const { setIsSectionBodyLoading, setIsSectionFilterLoading } =
this.clientLoadingStore;
const { setIsSectionFilterLoading } = this.clientLoadingStore;
const setIsLoading = (param) => {
setIsSectionBodyLoading(param);
setIsSectionFilterLoading(param);
};
@ -2193,11 +2183,9 @@ class FilesActionStore {
};
backToParentFolder = () => {
const { setIsSectionBodyLoading, setIsSectionFilterLoading } =
this.clientLoadingStore;
const { setIsSectionFilterLoading } = this.clientLoadingStore;
const setIsLoading = (param) => {
setIsSectionBodyLoading(param);
setIsSectionFilterLoading(param);
};