Просмотр исходного кода

refs #127093: Show alert only for non-empty page
- Add comment

Tatsuya Ise 2 лет назад
Родитель
Сommit
033cbb39cf
1 измененных файлов с 2 добавлено и 0 удалено
  1. 2 0
      apps/app/src/components/PageAlert/TrashPageAlert.tsx

+ 2 - 0
apps/app/src/components/PageAlert/TrashPageAlert.tsx

@@ -45,6 +45,7 @@ export const TrashPageAlert = (): JSX.Element => {
   const isEmptyPage = pageId == null || revisionId == null || pagePath == null;
 
   const openPutbackPageModalHandler = useCallback(() => {
+    // User cannot operate empty page.
     if (isEmptyPage) {
       return;
     }
@@ -65,6 +66,7 @@ export const TrashPageAlert = (): JSX.Element => {
   }, [currentPagePath, mutateCurrentPage, openPutBackPageModal, pageId, pagePath, router, isEmptyPage]);
 
   const openPageDeleteModalHandler = useCallback(() => {
+    // User cannot operate empty page.
     if (isEmptyPage) {
       return;
     }