From b495ae31bb2067b0889fa2eda894a870da438644 Mon Sep 17 00:00:00 2001 From: Tim Hostetler <6970899+thostetler@users.noreply.github.com> Date: Wed, 27 Mar 2024 16:58:11 -0400 Subject: [PATCH] Remove colormode cookie --- src/pages/_app.tsx | 6 +----- src/ssr-utils.ts | 7 ------- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx index 34acf0d2f..26c268cff 100644 --- a/src/pages/_app.tsx +++ b/src/pages/_app.tsx @@ -59,15 +59,11 @@ const NectarApp = memo(({ Component, pageProps }: AppProps): ReactElement => { const Providers: FC<{ pageProps: AppPageProps }> = ({ children, pageProps }) => { const createStore = useCreateStore(pageProps.dehydratedAppState ?? {}); - const colorModeManager = - typeof pageProps.colorModeCookie === 'string' - ? cookieStorageManagerSSR(pageProps.colorModeCookie) - : localStorageManager; return ( - + {children} diff --git a/src/ssr-utils.ts b/src/ssr-utils.ts index 7d6dfcd59..e2f9f5d6e 100644 --- a/src/ssr-utils.ts +++ b/src/ssr-utils.ts @@ -16,12 +16,6 @@ const injectNonce: IncomingGSSP = (ctx, prev) => { return Promise.resolve({ props: { nonce, ...prev.props } }); }; -const injectColorModeCookie: IncomingGSSP = (ctx, prev) => { - const colorMode = ctx.req.cookies['chakra-ui-color-mode'] ?? ''; - log.debug({ msg: 'Injecting color mode from cookie', colorMode }); - return Promise.resolve({ props: { colorModeCookie: `chakra-ui-color-mode=${colorMode}`, ...prev.props } }); -}; - const updateUserStateSSR: IncomingGSSP = (ctx, prevResult) => { const userData = ctx.req.session.token; @@ -70,7 +64,6 @@ export const composeNextGSSP = (...fns: IncomingGSSP[]) => > => { fns.push(injectNonce); fns.push(updateUserStateSSR); - fns.push(injectColorModeCookie); api.setUserData(ctx.req.session.token); let ssrProps = { props: {} }; for (const fn of fns) {