|
|
@@ -21,7 +21,7 @@ import {
|
|
|
usePageRenameModal, usePageDuplicateModal, usePageDeleteModal, usePutBackPageModal,
|
|
|
} from '~/stores/modal';
|
|
|
import {
|
|
|
- IPageInfoAll, IPageInfoForEntity, IPageInfoForListing, IPageWithMeta, isIPageInfoForListing,
|
|
|
+ IPageInfoAll, IPageInfoForEntity, IPageInfoForListing, IPageWithMeta, isIPageInfoForListing, IPageInfoForOperation,
|
|
|
} from '~/interfaces/page';
|
|
|
import { IPageSearchMeta, isIPageSearchMeta } from '~/interfaces/search';
|
|
|
import {
|
|
|
@@ -141,9 +141,14 @@ const PageListItemLSubstance: ForwardRefRenderFunction<ISelectable, Props> = (pr
|
|
|
|
|
|
const shouldDangerouslySetInnerHTMLForPaths = elasticSearchResult != null && elasticSearchResult.highlightedPath.length > 0;
|
|
|
|
|
|
- const likerCount = isSelected ? pageInfo?.likerIds.length : pageData.liker.length;
|
|
|
- const bookmarkCount = isSelected ? pageInfo?.bookmarkCount : pageMeta?.bookmarkCount;
|
|
|
-
|
|
|
+ let likerCount;
|
|
|
+ let bookmarkCount;
|
|
|
+ if (pageInfo != null && 'likerIds' in pageInfo) {
|
|
|
+ likerCount = isSelected ? pageInfo?.likerIds?.length : pageData.liker.length;
|
|
|
+ }
|
|
|
+ if (pageInfo != null && 'bookmarkCount' in pageInfo) {
|
|
|
+ bookmarkCount = isSelected ? pageInfo?.bookmarkCount : pageMeta?.bookmarkCount;
|
|
|
+ }
|
|
|
return (
|
|
|
<li
|
|
|
key={pageData._id}
|