Taichi Masuyama 4 лет назад
Родитель
Сommit
2166ff3a14
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      packages/app/src/components/Common/Dropdown/PageItemControl.tsx

+ 2 - 2
packages/app/src/components/Common/Dropdown/PageItemControl.tsx

@@ -6,7 +6,7 @@ import { useTranslation } from 'react-i18next';
 import { IPageHasId } from '~/interfaces/page';
 
 type PageItemControlProps = {
-  page: IPageHasId,
+  page: Partial<IPageHasId>,
   onClickDeleteButton?: (pageId: string)=>void,
 }
 
@@ -16,7 +16,7 @@ const PageItemControl: FC<PageItemControlProps> = (props: PageItemControlProps)
   const { t } = useTranslation('');
 
   const deleteButtonHandler = () => {
-    if (onClickDeleteButton != null) {
+    if (onClickDeleteButton != null && page._id != null) {
       onClickDeleteButton(page._id);
     }
   };