Yuki Takei před 3 roky
rodič
revize
321336cb5d

+ 2 - 1
packages/app/src/services/renderer/growi-renderer.ts

@@ -1,3 +1,4 @@
+import { isClient } from '@growi/core';
 import MarkdownIt from 'markdown-it';
 import MarkdownIt from 'markdown-it';
 
 
 import { Nullable } from '~/interfaces/common'; // TODO: Remove this asap when the ContextExtractor is removed
 import { Nullable } from '~/interfaces/common'; // TODO: Remove this asap when the ContextExtractor is removed
@@ -57,7 +58,7 @@ export default class GrowiRenderer {
     this.growiRendererConfig = growiRendererConfig;
     this.growiRendererConfig = growiRendererConfig;
     this.pagePath = pagePath;
     this.pagePath = pagePath;
 
 
-    if ((window as CustomWindow).growiRenderer != null) {
+    if (isClient() && (window as CustomWindow).growiRenderer != null) {
       this.preProcessors = (window as CustomWindow).growiRenderer.preProcessors;
       this.preProcessors = (window as CustomWindow).growiRenderer.preProcessors;
       this.postProcessors = (window as CustomWindow).growiRenderer.postProcessors;
       this.postProcessors = (window as CustomWindow).growiRenderer.postProcessors;
     }
     }

+ 1 - 0
packages/app/src/stores/context.tsx

@@ -225,6 +225,7 @@ export const useIsGuestUser = (): SWRResponse<boolean, Error> => {
   return useSWRImmutable(
   return useSWRImmutable(
     ['isGuestUser', currentUser],
     ['isGuestUser', currentUser],
     (key: Key, currentUser: IUser) => currentUser == null,
     (key: Key, currentUser: IUser) => currentUser == null,
+    { fallbackData: currentUser == null },
   );
   );
 };
 };