From 1c31f5f78f8313267c0db34cb2f774c64151b91d Mon Sep 17 00:00:00 2001 From: SangLv Date: Fri, 4 Aug 2023 09:52:29 +0700 Subject: [PATCH] fix loading --- frontend/src/pages/Workspace/index.tsx | 10 +++++++++- frontend/src/store/slice/User/UserSlice.ts | 8 +++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/frontend/src/pages/Workspace/index.tsx b/frontend/src/pages/Workspace/index.tsx index ca435629c..fd4a3739e 100644 --- a/frontend/src/pages/Workspace/index.tsx +++ b/frontend/src/pages/Workspace/index.tsx @@ -421,7 +421,15 @@ const Workspaces = () => { onChange={handleFileUpload} /> - New + { user ? diff --git a/frontend/src/store/slice/User/UserSlice.ts b/frontend/src/store/slice/User/UserSlice.ts index 0031fe986..f5cc8259e 100644 --- a/frontend/src/store/slice/User/UserSlice.ts +++ b/frontend/src/store/slice/User/UserSlice.ts @@ -52,7 +52,13 @@ export const userSlice = createSlice({ state.listUserSearch = action.payload }) .addMatcher( - isAnyOf(getListUser.pending, getListSearch.rejected, getListSearch.pending), + isAnyOf(getListSearch.rejected), + (state) => { + state.loading = false + }, + ) + .addMatcher( + isAnyOf(getListUser.pending, getListSearch.pending), (state) => { state.loading = true },