Explorar el Código

display alert

yohei0125 hace 3 años
padre
commit
5c5d84dcfd
Se han modificado 1 ficheros con 3 adiciones y 5 borrados
  1. 3 5
      packages/app/src/components/PageAlert/OldRevisionAlert.tsx

+ 3 - 5
packages/app/src/components/PageAlert/OldRevisionAlert.tsx

@@ -1,15 +1,13 @@
 import React from 'react';
 import React from 'react';
 import { useTranslation } from 'react-i18next';
 import { useTranslation } from 'react-i18next';
-import { useCurrentPageId } from '~/stores/context';
-import { useSWRxPageInfo } from '~/stores/page';
+import { useIsLatestRevision } from '~/stores/context';
 
 
 export const OldRevisionAlert = (): JSX.Element => {
 export const OldRevisionAlert = (): JSX.Element => {
 
 
   const { t } = useTranslation()
   const { t } = useTranslation()
-  const { data: currentPageId } = useCurrentPageId();
-  const { data: pageInfo } = useSWRxPageInfo(currentPageId);
+  const { data: isLatestRevision } = useIsLatestRevision();
 
 
-  if (pageInfo == null || pageInfo.isLatestRevision) {
+  if (isLatestRevision == null || isLatestRevision) {
     return <></>
     return <></>
   }
   }