Skip to content

Commit

Permalink
refactor loading
Browse files Browse the repository at this point in the history
  • Loading branch information
sanglevinh committed Aug 3, 2023
1 parent 16205e0 commit 7a10de6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 2 additions & 2 deletions frontend/src/components/PopupShare.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { useDispatch, useSelector } from "react-redux";
import { postListUserShare } from "../store/slice/Database/DatabaseActions";
import CancelIcon from '@mui/icons-material/Cancel'
import { postListUserShareWorkspaces } from "store/slice/Workspace/WorkspacesActions";
import { selectListSearch, selectListSearchLoading } from "../store/slice/User/UserSelector";
import { selectListSearch, selectLoading } from "../store/slice/User/UserSelector";
import { getListSearch } from "../store/slice/User/UserActions";
import Loading from "./common/Loading";
import { UserDTO } from "../api/users/UsersApiDTO";
Expand Down Expand Up @@ -78,7 +78,7 @@ const TableListSearch = ({usersSuggest, onClose, handleAddListUser, stateUserSha
const PopupShare = ({open, handleClose, data, usersShare, id, isWorkspace, title}: PopupType) => {
const [shareType, setShareType] = useState(data?.shareType || 0)
const usersSuggest = useSelector(selectListSearch)
const loading = useSelector(selectListSearchLoading)
const loading = useSelector(selectLoading)
const [textSearch, setTextSearch] = useState('')
const [stateUserShare, setStateUserShare] = useState(usersShare || undefined)
const dispatch = useDispatch()
Expand Down
2 changes: 0 additions & 2 deletions frontend/src/store/slice/User/UserSelector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ export const selectCurrentUserUid = (state: RootState) =>
export const selectCurrentUserEmail = (state: RootState) =>
selectCurrentUser(state)?.email
export const selectListSearch = (state: RootState) => state.user.listUserSearch
export const selectListSearchLoading = (state: RootState) => state.user.loading

export const isAdmin = (state: RootState) => {
return state.user && ROLE.ADMIN === state.user.currentUser?.role_id
}
Expand Down

0 comments on commit 7a10de6

Please sign in to comment.