|
|
@@ -413,14 +413,16 @@ export const useIsAbleToShowTrashPageManagementButtons = (): SWRResponse<boolean
|
|
|
};
|
|
|
|
|
|
export const useIsAbleToShowPageManagement = (): SWRResponse<boolean, Error> => {
|
|
|
- const key = 'isAbleToShowPageManagement';
|
|
|
const { data: currentPageId } = useCurrentPageId();
|
|
|
const { data: isTrashPage } = useIsTrashPage();
|
|
|
const { data: isSharedUser } = useIsSharedUser();
|
|
|
+ const { data: isEmpty } = useIsEmpty();
|
|
|
+
|
|
|
+ const key = `isAbleToShowPageManagement ${currentPageId}`;
|
|
|
|
|
|
const pageId = currentPageId;
|
|
|
const includesUndefined = [pageId, isTrashPage, isSharedUser].some(v => v === undefined);
|
|
|
- const isPageExist = pageId != null;
|
|
|
+ const isPageExist = (pageId != null) && !isEmpty;
|
|
|
|
|
|
return useSWRImmutable(
|
|
|
includesUndefined ? null : key,
|