From 808f007ba0a722d4301b1ba639b9c3a51985044e Mon Sep 17 00:00:00 2001 From: Timofey Boyko <55255132+TimofeyBoyko@users.noreply.github.com> Date: Mon, 5 Jun 2023 17:02:40 +0300 Subject: [PATCH] Web:Client: refactoring --- .../src/components/Article/Body/index.js | 3 +-- .../EmptyContainer/EmptyFolderContainer.js | 4 +--- .../EmptyContainer/RoomNoAccessContainer.js | 4 +--- .../EmptyContainer/RootFolderContainer.js | 4 +--- .../components/GlobalEvents/CreateEvent.js | 3 +-- .../components/panels/NewFilesPanel/index.js | 4 +--- .../src/pages/Home/MediaViewer/index.js | 2 -- .../src/pages/Home/Section/Header/index.js | 9 ++----- packages/client/src/pages/Home/index.js | 3 --- .../client/src/store/CreateEditRoomStore.js | 4 +--- .../client/src/store/FilesActionsStore.js | 24 +++++-------------- 11 files changed, 15 insertions(+), 49 deletions(-) diff --git a/packages/client/src/components/Article/Body/index.js b/packages/client/src/components/Article/Body/index.js index 66c7cf0d22..560134c18d 100644 --- a/packages/client/src/components/Article/Body/index.js +++ b/packages/client/src/components/Article/Body/index.js @@ -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); }; diff --git a/packages/client/src/components/EmptyContainer/EmptyFolderContainer.js b/packages/client/src/components/EmptyContainer/EmptyFolderContainer.js index 036aba3fbf..743afecd7d 100644 --- a/packages/client/src/components/EmptyContainer/EmptyFolderContainer.js +++ b/packages/client/src/components/EmptyContainer/EmptyFolderContainer.js @@ -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); }; diff --git a/packages/client/src/components/EmptyContainer/RoomNoAccessContainer.js b/packages/client/src/components/EmptyContainer/RoomNoAccessContainer.js index ff68040352..d357f9c751 100644 --- a/packages/client/src/components/EmptyContainer/RoomNoAccessContainer.js +++ b/packages/client/src/components/EmptyContainer/RoomNoAccessContainer.js @@ -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; diff --git a/packages/client/src/components/EmptyContainer/RootFolderContainer.js b/packages/client/src/components/EmptyContainer/RootFolderContainer.js index 90a1ee30ef..d87fb7bb5f 100644 --- a/packages/client/src/components/EmptyContainer/RootFolderContainer.js +++ b/packages/client/src/components/EmptyContainer/RootFolderContainer.js @@ -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); }; diff --git a/packages/client/src/components/GlobalEvents/CreateEvent.js b/packages/client/src/components/GlobalEvents/CreateEvent.js index 6e9dadc7cf..97e8a54b34 100644 --- a/packages/client/src/components/GlobalEvents/CreateEvent.js +++ b/packages/client/src/components/GlobalEvents/CreateEvent.js @@ -303,8 +303,7 @@ export default inject( settingsStore, clientLoadingStore, }) => { - const { setIsSectionBodyLoading, setIsSectionFilterLoading } = - clientLoadingStore; + const { setIsSectionBodyLoading } = clientLoadingStore; const setIsLoading = (param) => { setIsSectionBodyLoading(param); diff --git a/packages/client/src/components/panels/NewFilesPanel/index.js b/packages/client/src/components/panels/NewFilesPanel/index.js index 4a582bd46f..c7595c6445 100644 --- a/packages/client/src/components/panels/NewFilesPanel/index.js +++ b/packages/client/src/components/panels/NewFilesPanel/index.js @@ -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); }; diff --git a/packages/client/src/pages/Home/MediaViewer/index.js b/packages/client/src/pages/Home/MediaViewer/index.js index c506b071d2..c9302f1218 100644 --- a/packages/client/src/pages/Home/MediaViewer/index.js +++ b/packages/client/src/pages/Home/MediaViewer/index.js @@ -241,12 +241,10 @@ export default inject( const { firstLoad, - setIsSectionBodyLoading, setIsSectionFilterLoading, } = clientLoadingStore; const setIsLoading = (param) => { - setIsSectionBodyLoading(param); setIsSectionFilterLoading(param); }; diff --git a/packages/client/src/pages/Home/Section/Header/index.js b/packages/client/src/pages/Home/Section/Header/index.js index c61106ca62..8d2da72d92 100644 --- a/packages/client/src/pages/Home/Section/Header/index.js +++ b/packages/client/src/pages/Home/Section/Header/index.js @@ -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); }; diff --git a/packages/client/src/pages/Home/index.js b/packages/client/src/pages/Home/index.js index 970ffb1597..c6b1820cc1 100644 --- a/packages/client/src/pages/Home/index.js +++ b/packages/client/src/pages/Home/index.js @@ -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); }; diff --git a/packages/client/src/store/CreateEditRoomStore.js b/packages/client/src/store/CreateEditRoomStore.js index e932c44b20..73d0a29ff2 100644 --- a/packages/client/src/store/CreateEditRoomStore.js +++ b/packages/client/src/store/CreateEditRoomStore.js @@ -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); }; diff --git a/packages/client/src/store/FilesActionsStore.js b/packages/client/src/store/FilesActionsStore.js index 473b13a351..c97b6a975c 100644 --- a/packages/client/src/store/FilesActionsStore.js +++ b/packages/client/src/store/FilesActionsStore.js @@ -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); };