diff --git a/packages/client/src/components/wiki/tocs/index.tsx b/packages/client/src/components/wiki/tocs/index.tsx index 8125a924..ad484acb 100644 --- a/packages/client/src/components/wiki/tocs/index.tsx +++ b/packages/client/src/components/wiki/tocs/index.tsx @@ -23,13 +23,12 @@ interface IProps { const { Text } = Typography; export const WikiTocs: React.FC = ({ - // pageTitle, wikiId, documentId = null, docAsLink = '/wiki/[wikiId]/document/[documentId]', getDocLink = (documentId) => `/wiki/${wikiId}/document/${documentId}`, }) => { - const { pathname } = useRouter(); + const { pathname, query } = useRouter(); const { data: wiki, loading: wikiLoading, error: wikiError } = useWikiDetail(wikiId); const { data: tocs, loading: tocsLoading, error: tocsError, refresh } = useWikiTocs(wikiId); const [parentIds, setParentIds] = useState>([]); @@ -91,7 +90,7 @@ export const WikiTocs: React.FC = ({ pathname: `/wiki/[wikiId]`, query: { wikiId }, }} - isActive={pathname === '/wiki/[wikiId]'} + isActive={pathname === '/wiki/[wikiId]' || (query && wiki && query.documentId === wiki.homeDocumentId)} />