fix: frontend permission check (#784)
This commit is contained in:
@@ -6,6 +6,7 @@ import { useRouter } from 'next/navigation'
|
||||
import { debounce } from 'lodash-es'
|
||||
import Indicator from '../../indicator'
|
||||
import AppIcon from '@/app/components/base/app-icon'
|
||||
import { useAppContext } from '@/context/app-context'
|
||||
|
||||
type NavItem = {
|
||||
id: string
|
||||
@@ -29,6 +30,7 @@ const itemClassName = `
|
||||
|
||||
const NavSelector = ({ curNav, navs, createText, onCreate, onLoadmore }: INavSelectorProps) => {
|
||||
const router = useRouter()
|
||||
const { isCurrentWorkspaceManager } = useAppContext()
|
||||
|
||||
const handleScroll = useCallback(debounce((e) => {
|
||||
if (typeof onLoadmore === 'function') {
|
||||
@@ -81,7 +83,7 @@ const NavSelector = ({ curNav, navs, createText, onCreate, onLoadmore }: INavSel
|
||||
))
|
||||
}
|
||||
</div>
|
||||
<Menu.Item>
|
||||
{isCurrentWorkspaceManager && <Menu.Item>
|
||||
<div className='p-1' onClick={onCreate}>
|
||||
<div
|
||||
className='flex items-center h-12 rounded-lg cursor-pointer hover:bg-gray-100'
|
||||
@@ -98,7 +100,7 @@ const NavSelector = ({ curNav, navs, createText, onCreate, onLoadmore }: INavSel
|
||||
<div className='font-normal text-[14px] text-gray-700'>{createText}</div>
|
||||
</div>
|
||||
</div>
|
||||
</Menu.Item>
|
||||
</Menu.Item>}
|
||||
</Menu.Items>
|
||||
</Menu>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user