File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
apps/app/src/client/components/PageSideContents Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,8 @@ import React, {
55 type JSX ,
66} from 'react' ;
77
8- import type { IPagePopulatedToShowRevision , IPageInfoForOperation } from '@growi/core' ;
8+ import type { IPagePopulatedToShowRevision } from '@growi/core' ;
9+ import { isIPageInfoForOperation } from '@growi/core/dist/interfaces' ;
910import { pagePathUtils } from '@growi/core/dist/utils' ;
1011import { useAtomValue } from 'jotai' ;
1112import { useTranslation } from 'next-i18next' ;
@@ -129,7 +130,7 @@ export const PageSideContents = (props: PageSideContentsProps): JSX.Element => {
129130 icon = { < span className = "material-symbols-outlined" > subject</ span > }
130131 label = { t ( 'page_list' ) }
131132 // Do not display CountBadge if '/trash/*': https://github.com/growilabs/growi/pull/7600
132- count = { ! isTrash && pageInfo != null ? ( pageInfo as IPageInfoForOperation ) . descendantCount : undefined }
133+ count = { ! isTrash && isIPageInfoForOperation ( pageInfo ) ? pageInfo . descendantCount : undefined }
133134 offset = { 1 }
134135 onClick = { ( ) => openDescendantPageListModal ( pagePath ) }
135136 />
@@ -142,7 +143,7 @@ export const PageSideContents = (props: PageSideContentsProps): JSX.Element => {
142143 < PageAccessoriesControl
143144 icon = { < span className = "material-symbols-outlined" > chat</ span > }
144145 label = { t ( 'comments' ) }
145- count = { pageInfo != null ? ( pageInfo as IPageInfoForOperation ) . commentCount : undefined }
146+ count = { isIPageInfoForOperation ( pageInfo ) ? pageInfo . commentCount : undefined }
146147 onClick = { ( ) => scroller . scrollTo ( 'comments-container' , { smooth : false , offset : - 120 } ) }
147148 />
148149 </ div >
You can’t perform that action at this time.
0 commit comments