Yuki Takei 3 лет назад
Родитель
Сommit
5773476625
1 измененных файлов с 4 добавлено и 4 удалено
  1. 4 4
      apps/app/src/stores/renderer.tsx

+ 4 - 4
apps/app/src/stores/renderer.tsx

@@ -24,13 +24,13 @@ export const useViewOptions = (): SWRResponse<RendererOptions, Error> => {
   }, [mutateCurrentPageTocNode]);
   }, [mutateCurrentPageTocNode]);
 
 
   const isAllDataValid = currentPagePath != null && rendererConfig != null;
   const isAllDataValid = currentPagePath != null && rendererConfig != null;
+  const customGenerater = getGrowiFacade().markdownRenderer?.optionsGenerators?.customGenerateViewOptions;
 
 
   return useSWR(
   return useSWR(
     isAllDataValid
     isAllDataValid
-      ? ['viewOptions', currentPagePath, rendererConfig]
+      ? ['viewOptions', currentPagePath, rendererConfig, customGenerater]
       : null,
       : null,
     async([, currentPagePath, rendererConfig]) => {
     async([, currentPagePath, rendererConfig]) => {
-      const customGenerater = getGrowiFacade().markdownRenderer?.optionsGenerators?.customGenerateViewOptions;
       if (customGenerater != null) {
       if (customGenerater != null) {
         return customGenerater(currentPagePath, rendererConfig, storeTocNodeHandler);
         return customGenerater(currentPagePath, rendererConfig, storeTocNodeHandler);
       }
       }
@@ -74,13 +74,13 @@ export const usePreviewOptions = (): SWRResponse<RendererOptions, Error> => {
   const { data: rendererConfig } = useRendererConfig();
   const { data: rendererConfig } = useRendererConfig();
 
 
   const isAllDataValid = currentPagePath != null && rendererConfig != null;
   const isAllDataValid = currentPagePath != null && rendererConfig != null;
+  const customGenerater = getGrowiFacade().markdownRenderer?.optionsGenerators?.customGeneratePreviewOptions;
 
 
   return useSWR(
   return useSWR(
     isAllDataValid
     isAllDataValid
-      ? ['previewOptions', rendererConfig, currentPagePath]
+      ? ['previewOptions', rendererConfig, currentPagePath, customGenerater]
       : null,
       : null,
     async([, rendererConfig, pagePath]) => {
     async([, rendererConfig, pagePath]) => {
-      const customGenerater = getGrowiFacade().markdownRenderer?.optionsGenerators?.customGeneratePreviewOptions;
       if (customGenerater != null) {
       if (customGenerater != null) {
         return customGenerater(rendererConfig, pagePath);
         return customGenerater(rendererConfig, pagePath);
       }
       }