Yuki Takei 3 лет назад
Родитель
Сommit
af62a1a664
1 измененных файлов с 10 добавлено и 7 удалено
  1. 10 7
      packages/app/src/pages/_app.page.tsx

+ 10 - 7
packages/app/src/pages/_app.page.tsx

@@ -13,7 +13,7 @@ import { useI18nextHMR } from '~/services/i18next-hmr';
 import {
   useAppTitle, useConfidential, useGrowiVersion, useSiteUrl, useIsDefaultLogo, useForcedColorScheme,
 } from '~/stores/context';
-
+import { swrGlobalConfiguration } from '~/utils/swr-utils';
 
 import { CommonProps } from './utils/commons';
 import { registerTransformerForObjectId } from './utils/objectid-transformer';
@@ -25,13 +25,16 @@ import '~/styles/theme/_apply-colors.scss';
 
 const isDev = process.env.NODE_ENV === 'development';
 
-const swrConfig = isServer()
+const swrConfig = Object.assign(
+  {},
+  swrGlobalConfiguration,
   // set the request scoped cache provider in server
-  ? {
-    provider: (cache: any) => new Map<string, any>(cache),
-  }
-  : {};
-
+  isServer()
+    ? {
+      provider: (cache: any) => new Map<string, any>(cache),
+    }
+    : {},
+);
 
 // eslint-disable-next-line @typescript-eslint/ban-types
 export type NextPageWithLayout<P = {}, IP = P> = NextPage<P, IP> & {