mirror of
http://112.124.100.131/huang.ze/ebiz-dify-ai.git
synced 2025-12-09 10:56:52 +08:00
fix: toggling AppDetailNav causes unnecessary component rerenders (#3718)
This commit is contained in:
@@ -40,7 +40,7 @@ const AppNav = () => {
|
||||
const { t } = useTranslation()
|
||||
const { appId } = useParams()
|
||||
const { isCurrentWorkspaceManager } = useAppContext()
|
||||
const { appDetail } = useAppStore()
|
||||
const appDetail = useAppStore(state => state.appDetail)
|
||||
const [showNewAppDialog, setShowNewAppDialog] = useState(false)
|
||||
const [showNewAppTemplateDialog, setShowNewAppTemplateDialog] = useState(false)
|
||||
const [showCreateFromDSLModal, setShowCreateFromDSLModal] = useState(false)
|
||||
|
||||
@@ -31,7 +31,7 @@ const Nav = ({
|
||||
onLoadmore,
|
||||
isApp,
|
||||
}: INavProps) => {
|
||||
const { setAppDetail } = useAppStore()
|
||||
const setAppDetail = useAppStore(state => state.setAppDetail)
|
||||
const [hovered, setHovered] = useState(false)
|
||||
const segment = useSelectedLayoutSegment()
|
||||
const isActived = Array.isArray(activeSegment) ? activeSegment.includes(segment!) : segment === activeSegment
|
||||
|
||||
@@ -35,7 +35,7 @@ const NavSelector = ({ curNav, navs, createText, isApp, onCreate, onLoadmore }:
|
||||
const { t } = useTranslation()
|
||||
const router = useRouter()
|
||||
const { isCurrentWorkspaceManager } = useAppContext()
|
||||
const { setAppDetail } = useAppStore()
|
||||
const setAppDetail = useAppStore(state => state.setAppDetail)
|
||||
|
||||
const handleScroll = useCallback(debounce((e) => {
|
||||
if (typeof onLoadmore === 'function') {
|
||||
|
||||
Reference in New Issue
Block a user