fix: member always get redirect to own workspace

This commit is contained in:
chungyau97 2025-07-10 17:49:10 +08:00
parent da8623d8aa
commit 46dc4324b6
1 changed files with 6 additions and 4 deletions

View File

@ -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])