Yuki Takei 3 лет назад
Родитель
Сommit
7fff6ef2c9
1 измененных файлов с 3 добавлено и 2 удалено
  1. 3 2
      packages/app/src/components/Page/RevisionRenderer.tsx

+ 3 - 2
packages/app/src/components/Page/RevisionRenderer.tsx

@@ -6,7 +6,7 @@ import { blinkElem } from '~/client/util/blink-section-header';
 import { addSmoothScrollEvent } from '~/client/util/smooth-scroll';
 import { CustomWindow } from '~/interfaces/global';
 import GrowiRenderer from '~/services/renderer/growi-renderer';
-import { useInterceptorManager } from '~/stores/context';
+import { useCurrentPathname, useInterceptorManager } from '~/stores/context';
 import { useEditorSettings } from '~/stores/editor';
 import loggerFactory from '~/utils/logger';
 
@@ -102,6 +102,7 @@ const RevisionRenderer = (props: Props): JSX.Element => {
 
   const { data: interceptorManager } = useInterceptorManager();
   const { data: editorSettings } = useEditorSettings();
+  const { data: currentPathname } = useCurrentPathname();
 
   const currentRenderingContext = useMemo(() => {
     return {
@@ -109,7 +110,7 @@ const RevisionRenderer = (props: Props): JSX.Element => {
       parsedHTML: '',
       pagePath,
       renderDrawioInRealtime: editorSettings?.renderDrawioInRealtime,
-      currentPathname: decodeURIComponent(window.location.pathname),
+      currentPathname: decodeURIComponent(currentPathname ?? '/'),
     };
   }, [editorSettings?.renderDrawioInRealtime, markdown, pagePath]);