|
|
@@ -1,5 +1,7 @@
|
|
|
import React, { useCallback, useState } from 'react';
|
|
|
+
|
|
|
import { useTranslation } from 'react-i18next';
|
|
|
+
|
|
|
import { toastSuccess } from '~/client/util/apiNotification';
|
|
|
import {
|
|
|
IDataWithMeta,
|
|
|
@@ -9,13 +11,12 @@ import {
|
|
|
import { IPagingResult } from '~/interfaces/paging-result';
|
|
|
import { OnDeletedFunction, OnPutBackedFunction } from '~/interfaces/ui';
|
|
|
import { useIsGuestUser, useIsSharedUser, useIsTrashPage } from '~/stores/context';
|
|
|
-
|
|
|
import {
|
|
|
useSWRxDescendantsPageListForCurrrentPath, useSWRxPageInfoForList, useSWRxPageList, useDescendantsPageListForCurrentPathTermManager,
|
|
|
} from '~/stores/page';
|
|
|
import { usePageTreeTermManager } from '~/stores/page-listing';
|
|
|
-import { ForceHideMenuItems, MenuItemType } from './Common/Dropdown/PageItemControl';
|
|
|
|
|
|
+import { ForceHideMenuItems, MenuItemType } from './Common/Dropdown/PageItemControl';
|
|
|
import PageList from './PageList/PageList';
|
|
|
import PaginationWrapper from './PaginationWrapper';
|
|
|
|
|
|
@@ -61,7 +62,14 @@ export const DescendantsPageListSubstance = (props: SubstanceProps): JSX.Element
|
|
|
}
|
|
|
|
|
|
const pageDeletedHandler: OnDeletedFunction = useCallback((...args) => {
|
|
|
- toastSuccess(args[2] ? t('deleted_pages_completely') : t('deleted_pages'));
|
|
|
+ const path = args[0];
|
|
|
+ const isCompletely = args[2];
|
|
|
+ if (path == null || isCompletely == null) {
|
|
|
+ toastSuccess(t('deleted_page'));
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ toastSuccess(t('deleted_pages_completely', { path }));
|
|
|
+ }
|
|
|
|
|
|
advancePt();
|
|
|
|