mirror of
https://github.com/langgenius/dify.git
synced 2025-08-15 04:37:10 +00:00
fix: page loop in datasets and apps if current user is dataset_operator (#21114)
This commit is contained in:
parent
110bb5e5a5
commit
c5acffb034
@ -8,15 +8,15 @@ import { useRouter } from 'next/navigation'
|
||||
import { useEffect } from 'react'
|
||||
|
||||
export default function DatasetsLayout({ children }: { children: React.ReactNode }) {
|
||||
const { isCurrentWorkspaceEditor } = useAppContext()
|
||||
const { isCurrentWorkspaceEditor, isCurrentWorkspaceDatasetOperator } = useAppContext()
|
||||
const router = useRouter()
|
||||
|
||||
useEffect(() => {
|
||||
if (!isCurrentWorkspaceEditor)
|
||||
if (!isCurrentWorkspaceEditor && !isCurrentWorkspaceDatasetOperator)
|
||||
router.replace('/apps')
|
||||
}, [isCurrentWorkspaceEditor, router])
|
||||
}, [isCurrentWorkspaceEditor, isCurrentWorkspaceDatasetOperator, router])
|
||||
|
||||
if (!isCurrentWorkspaceEditor)
|
||||
if (!isCurrentWorkspaceEditor && !isCurrentWorkspaceDatasetOperator)
|
||||
return <Loading type='app' />
|
||||
return (
|
||||
<ExternalKnowledgeApiProvider>
|
||||
|
Loading…
x
Reference in New Issue
Block a user