fix: member always get redirect to own workspace
This commit is contained in:
parent
da8623d8aa
commit
46dc4324b6
|
|
@ -71,10 +71,12 @@ export const RequireAuth = ({ permission, display, children }) => {
|
||||||
const [isBillingLoading, setIsBillingLoading] = useState(false)
|
const [isBillingLoading, setIsBillingLoading] = useState(false)
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (currentUser && currentUser.isOrganizationAdmin === false) {
|
if (organization && organization.status === 'past_due') {
|
||||||
handleSwitchWorkspace(currentUser)
|
if (currentUser && currentUser.isOrganizationAdmin === false) {
|
||||||
} else if (organization && organization.status === 'past_due') {
|
handleSwitchWorkspace(currentUser)
|
||||||
setShowOrgPastDueDialog(true)
|
} else {
|
||||||
|
setShowOrgPastDueDialog(true)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, [organization, currentUser])
|
}, [organization, currentUser])
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue