@@ -13,36 +13,25 @@ import {
1313 useIsCollaborativeEditable ,
1414 useTrans ,
1515} from '../../doc-management' ;
16- import { useDocChildren , useDocTree } from '../../doc-tree' ;
1716
1817interface DocHeaderInfoProps {
1918 doc : Doc ;
2019}
2120
2221export const DocHeaderInfo = ( { doc } : DocHeaderInfoProps ) => {
23- const { data : tree } = useDocTree ( { docId : doc . id } ) ;
2422 const { isDesktop } = useResponsiveStore ( ) ;
2523 const treeContext = useTreeContext < Doc | null > ( ) ;
2624 const { transRole } = useTrans ( ) ;
2725 const { isEditable } = useIsCollaborativeEditable ( doc ) ;
2826 const { relativeDate, calculateDaysLeft } = useDate ( ) ;
2927 const { data : config } = useConfig ( ) ;
3028
31- const { data : childrenPage } = useDocChildren (
32- { docId : doc . id , page_size : 1 } ,
33- { enabled : true } ,
34- ) ;
3529 const countFromTreeContext =
3630 treeContext ?. root ?. id === doc . id
3731 ? treeContext ?. treeData ?. nodes ?. length
3832 : undefined ;
3933
40- const childrenCount =
41- countFromTreeContext ??
42- childrenPage ?. count ??
43- doc . numchild ??
44- tree ?. children ?. length ??
45- 0 ;
34+ const childrenCount = countFromTreeContext ?? doc . numchild ?? 0 ;
4635
4736 let dateToDisplay = t ( 'Last update: {{update}}' , {
4837 update : relativeDate ( doc . updated_at ) ,
0 commit comments