kaori пре 4 година
родитељ
комит
778f5b0c95

+ 1 - 5
packages/app/src/components/Navbar/GrowiContextualSubNavigation.tsx

@@ -15,7 +15,6 @@ import {
   usePageAccessoriesModal, PageAccessoriesModalContents,
   usePageAccessoriesModal, PageAccessoriesModalContents,
   usePageDuplicateModal, usePageRenameModal, usePageDeleteModal, OnDeletedFunction, usePagePresentationModal,
   usePageDuplicateModal, usePageRenameModal, usePageDeleteModal, OnDeletedFunction, usePagePresentationModal,
 } from '~/stores/modal';
 } from '~/stores/modal';
-import { useSWRxPageChildren } from '~/stores/page-listing';
 
 
 
 
 import {
 import {
@@ -145,7 +144,6 @@ const GrowiContextualSubNavigation = (props) => {
   const { data: isAbleToShowPageEditorModeManager } = useIsAbleToShowPageEditorModeManager();
   const { data: isAbleToShowPageEditorModeManager } = useIsAbleToShowPageEditorModeManager();
   const { data: isAbleToShowPageAuthors } = useIsAbleToShowPageAuthors();
   const { data: isAbleToShowPageAuthors } = useIsAbleToShowPageAuthors();
 
 
-  const { mutate: mutateChildren } = useSWRxPageChildren(path);
   const { mutate: mutateSWRTagsInfo, data: tagsInfoData } = useSWRTagsInfo(pageId);
   const { mutate: mutateSWRTagsInfo, data: tagsInfoData } = useSWRTagsInfo(pageId);
 
 
   const { open: openDuplicateModal } = usePageDuplicateModal();
   const { open: openDuplicateModal } = usePageDuplicateModal();
@@ -195,8 +193,6 @@ const GrowiContextualSubNavigation = (props) => {
       return;
       return;
     }
     }
 
 
-    mutateChildren();
-
     const path = pathOrPathsToDelete;
     const path = pathOrPathsToDelete;
 
 
     if (isCompletely) {
     if (isCompletely) {
@@ -206,7 +202,7 @@ const GrowiContextualSubNavigation = (props) => {
     else {
     else {
       window.location.reload();
       window.location.reload();
     }
     }
-  }, [mutateChildren]);
+  }, []);
 
 
   const deleteItemClickedHandler = useCallback(async(pageToDelete, isAbleToDeleteCompletely) => {
   const deleteItemClickedHandler = useCallback(async(pageToDelete, isAbleToDeleteCompletely) => {
     openDeleteModal([pageToDelete], onDeletedHandler, isAbleToDeleteCompletely);
     openDeleteModal([pageToDelete], onDeletedHandler, isAbleToDeleteCompletely);

+ 1 - 5
packages/app/src/components/PageList/PageListItemL.tsx

@@ -17,7 +17,6 @@ import { useIsDeviceSmallerThanLg } from '~/stores/ui';
 import {
 import {
   usePageRenameModal, usePageDuplicateModal, usePageDeleteModal, OnDeletedFunction,
   usePageRenameModal, usePageDuplicateModal, usePageDeleteModal, OnDeletedFunction,
 } from '~/stores/modal';
 } from '~/stores/modal';
-import { useSWRxPageChildren } from '~/stores/page-listing';
 import {
 import {
   IPageInfoAll, IPageWithMeta, isIPageInfoForEntity, isIPageInfoForListing,
   IPageInfoAll, IPageWithMeta, isIPageInfoForEntity, isIPageInfoForListing,
 } from '~/interfaces/page';
 } from '~/interfaces/page';
@@ -65,7 +64,6 @@ const PageListItemLSubstance: ForwardRefRenderFunction<ISelectable, Props> = (pr
   }));
   }));
 
 
   const { data: isDeviceSmallerThanLg } = useIsDeviceSmallerThanLg();
   const { data: isDeviceSmallerThanLg } = useIsDeviceSmallerThanLg();
-  const { mutate: mutateChildren } = useSWRxPageChildren(pageData.path);
   const { open: openDuplicateModal } = usePageDuplicateModal();
   const { open: openDuplicateModal } = usePageDuplicateModal();
   const { open: openRenameModal } = usePageRenameModal();
   const { open: openRenameModal } = usePageRenameModal();
   const { open: openDeleteModal } = usePageDeleteModal();
   const { open: openDeleteModal } = usePageDeleteModal();
@@ -107,8 +105,6 @@ const PageListItemLSubstance: ForwardRefRenderFunction<ISelectable, Props> = (pr
       return;
       return;
     }
     }
 
 
-    mutateChildren();
-
     const path = pathOrPathsToDelete;
     const path = pathOrPathsToDelete;
 
 
     if (isRecursively) {
     if (isRecursively) {
@@ -128,7 +124,7 @@ const PageListItemLSubstance: ForwardRefRenderFunction<ISelectable, Props> = (pr
         toastSuccess(t('deleted_single_page', { path }));
         toastSuccess(t('deleted_single_page', { path }));
       }
       }
     }
     }
-  }, [mutateChildren, t]);
+  }, [t]);
 
 
   const deleteMenuItemClickHandler = useCallback((_id, pageInfo) => {
   const deleteMenuItemClickHandler = useCallback((_id, pageInfo) => {
     const { _id: pageId, revision: revisionId, path } = pageData;
     const { _id: pageId, revision: revisionId, path } = pageData;

+ 1 - 4
packages/app/src/components/Sidebar/PageTree/ItemsTree.tsx

@@ -4,7 +4,7 @@ import { useTranslation } from 'react-i18next';
 import { IPageHasId } from '../../../interfaces/page';
 import { IPageHasId } from '../../../interfaces/page';
 import { ItemNode } from './ItemNode';
 import { ItemNode } from './ItemNode';
 import Item from './Item';
 import Item from './Item';
-import { useSWRxPageAncestorsChildren, useSWRxPageChildren, useSWRxRootPage } from '../../../stores/page-listing';
+import { useSWRxPageAncestorsChildren, useSWRxRootPage } from '../../../stores/page-listing';
 import { TargetAndAncestors } from '~/interfaces/page-listing-results';
 import { TargetAndAncestors } from '~/interfaces/page-listing-results';
 import { toastError, toastSuccess } from '~/client/util/apiNotification';
 import { toastError, toastSuccess } from '~/client/util/apiNotification';
 import {
 import {
@@ -95,7 +95,6 @@ const ItemsTree: FC<ItemsTreeProps> = (props: ItemsTreeProps) => {
   const { t } = useTranslation();
   const { t } = useTranslation();
 
 
   const { data: ancestorsChildrenData, error: error1 } = useSWRxPageAncestorsChildren(targetPath);
   const { data: ancestorsChildrenData, error: error1 } = useSWRxPageAncestorsChildren(targetPath);
-  const { mutate: mutateChildren } = useSWRxPageChildren(targetPathOrId);
   const { data: rootPageData, error: error2 } = useSWRxRootPage();
   const { data: rootPageData, error: error2 } = useSWRxRootPage();
   const { open: openDuplicateModal } = usePageDuplicateModal();
   const { open: openDuplicateModal } = usePageDuplicateModal();
   const { open: openRenameModal } = usePageRenameModal();
   const { open: openRenameModal } = usePageRenameModal();
@@ -123,8 +122,6 @@ const ItemsTree: FC<ItemsTreeProps> = (props: ItemsTreeProps) => {
       return;
       return;
     }
     }
 
 
-    mutateChildren();
-
     const path = pathOrPathsToDelete;
     const path = pathOrPathsToDelete;
 
 
     if (isRecursively) {
     if (isRecursively) {