Skip to content

Commit

Permalink
fix loading
Browse files Browse the repository at this point in the history
  • Loading branch information
sanglevinh committed Aug 4, 2023
1 parent 4f0d4e0 commit 1c31f5f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
10 changes: 9 additions & 1 deletion frontend/src/pages/Workspace/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,15 @@ const Workspaces = () => {
onChange={handleFileUpload}
/>
</label>
<ButtonCustom onClick={handleOpenPopupNew}>New</ButtonCustom>
<Button
sx={{
background: '#000000c4',
'&:hover': {
backgroundColor: '#000000fc',
},
}}
variant="contained"
onClick={handleOpenPopupNew}>New</Button>
</Box>
{
user ?
Expand Down
8 changes: 7 additions & 1 deletion frontend/src/store/slice/User/UserSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
},
Expand Down

0 comments on commit 1c31f5f

Please sign in to comment.