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)
|
||||
|
||||
useEffect(() => {
|
||||
if (currentUser && currentUser.isOrganizationAdmin === false) {
|
||||
handleSwitchWorkspace(currentUser)
|
||||
} else if (organization && organization.status === 'past_due') {
|
||||
setShowOrgPastDueDialog(true)
|
||||
if (organization && organization.status === 'past_due') {
|
||||
if (currentUser && currentUser.isOrganizationAdmin === false) {
|
||||
handleSwitchWorkspace(currentUser)
|
||||
} else {
|
||||
setShowOrgPastDueDialog(true)
|
||||
}
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [organization, currentUser])
|
||||
|
|
|
|||
Loading…
Reference in New Issue