mirror of
https://github.com/langgenius/dify.git
synced 2026-05-13 08:57:28 +08:00
- Remove appDetail and setAppDetail from Zustand store - Use useAppDetail hook for server state management - Child components now call useAppDetail(appId) directly via useParams() - Replace setAppDetail calls with useInvalidateAppDetail for cache invalidation - Keep only client UI state in Zustand (sidebar, modals) - Split sidebar initialization useEffect for clearer separation of concerns - Update test mocks to use TanStack Query pattern - Fix missing dependencies in use-checklist.ts useMemo/useCallback hooks
11 lines
324 B
TypeScript
11 lines
324 B
TypeScript
import { useParams } from 'next/navigation'
|
|
import { useAppDetail } from '@/service/use-apps'
|
|
import { AppModeEnum } from '@/types/app'
|
|
|
|
export const useIsChatMode = () => {
|
|
const { appId } = useParams()
|
|
const { data: appDetail } = useAppDetail(appId as string)
|
|
|
|
return appDetail?.mode === AppModeEnum.ADVANCED_CHAT
|
|
}
|