|
|
@@ -1,13 +1,14 @@
|
|
|
import React, { useMemo, useCallback, type JSX } from 'react';
|
|
|
|
|
|
import type { IPageHasId } from '@growi/core';
|
|
|
+import { useAtomValue } from 'jotai';
|
|
|
import { useTranslation } from 'next-i18next';
|
|
|
import dynamic from 'next/dynamic';
|
|
|
|
|
|
import { toastSuccess } from '~/client/util/toastr';
|
|
|
import type { IPagingResult } from '~/interfaces/paging-result';
|
|
|
import { useIsReadOnlyUser } from '~/states/context';
|
|
|
-import { useShowPageLimitationXL } from '~/states/server-configurations';
|
|
|
+import { showPageLimitationXLAtom } from '~/states/server-configurations';
|
|
|
import { useEmptyTrashModal } from '~/stores/modal';
|
|
|
import { useSWRxPageInfoForList, useSWRxPageList } from '~/stores/page-listing';
|
|
|
|
|
|
@@ -26,8 +27,8 @@ const convertToIDataWithMeta = (page) => {
|
|
|
const useEmptyTrashButton = () => {
|
|
|
|
|
|
const { t } = useTranslation();
|
|
|
- const [limit] = useShowPageLimitationXL();
|
|
|
- const [isReadOnlyUser] = useIsReadOnlyUser();
|
|
|
+ const limit = useAtomValue(showPageLimitationXLAtom);
|
|
|
+ const isReadOnlyUser = useIsReadOnlyUser();
|
|
|
const { data: pagingResult, mutate: mutatePageLists } = useSWRxPageList('/trash', 1, limit);
|
|
|
const { open: openEmptyTrashModal } = useEmptyTrashModal();
|
|
|
|
|
|
@@ -64,7 +65,7 @@ const useEmptyTrashButton = () => {
|
|
|
};
|
|
|
|
|
|
const DescendantsPageListForTrash = (): JSX.Element => {
|
|
|
- const [limit] = useShowPageLimitationXL();
|
|
|
+ const limit = useAtomValue(showPageLimitationXLAtom);
|
|
|
|
|
|
return (
|
|
|
<DescendantsPageList
|