Skip to content

Commit

Permalink
[add] localeDetection and no-cache to off
Browse files Browse the repository at this point in the history
  • Loading branch information
ymuichiro committed Nov 18, 2023
1 parent b292196 commit 1f7eea3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
1 change: 1 addition & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const nextConfig = withPWA({
i18n: {
locales: ['en', 'ja', 'ko', 'zh', 'zh-hant-tw'],
defaultLocale: 'en',
localeDetection: false,
},
images: {
domains: ['cms.symbol-community.com'],
Expand Down
27 changes: 13 additions & 14 deletions src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { ThemeProvider } from '@mui/material/styles';
import { AppProps } from 'next/app';
import Head from 'next/head';
import { GoogleAnalytics } from 'nextjs-google-analytics';
import { useEffect } from 'react';

// Client-side cache, shared for the whole session of the user in the browser.
const clientSideEmotionCache = createEmotionCache();
Expand All @@ -26,20 +25,20 @@ if (
export default function MyApp(props: MyAppProps) {
const { Component, emotionCache = clientSideEmotionCache, pageProps } = props;

// TODO: 後日削除
useEffect(() => {
navigator.serviceWorker.getRegistrations().then((registrations) => {
for (const registration of registrations) {
registration.unregister();
}
});
// // キャッシュ削除を強制したいとき
// useEffect(() => {
// navigator.serviceWorker.getRegistrations().then((registrations) => {
// for (const registration of registrations) {
// registration.unregister();
// }
// });

caches.keys().then((keys) => {
keys.forEach((key) => {
caches.delete(key);
});
});
}, []);
// caches.keys().then((keys) => {
// keys.forEach((key) => {
// caches.delete(key);
// });
// });
// }, []);

return (
<CacheProvider value={emotionCache}>
Expand Down

0 comments on commit 1f7eea3

Please sign in to comment.