Skip to content

Commit ba561da

Browse files
committed
Remove logs
1 parent 472bd31 commit ba561da

File tree

2 files changed

+5
-23
lines changed

2 files changed

+5
-23
lines changed

src/lib/colorScheme.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ const useColorSchemeServerSide: UseColorScheme = () => {
3030
/* nothing */
3131
});
3232

33-
console.log("(server) useColorSchemeServerSide: ", $colorScheme.current);
34-
3533
return {
3634
"colorScheme": $colorScheme.current,
3735
setColorScheme

src/lib/nextJs.tsx

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -150,28 +150,12 @@ export function withAppDsfr<AppComponent extends NextComponentType<any, any, any
150150
);
151151

152152
if (!isBrowser) {
153-
/*
154-
$colorScheme.current = (() => {
155-
156-
const cookie = appContext.ctx.req?.headers.cookie
157-
158-
return cookie === undefined ? undefined : readColorSchemeInCookie(cookie);
159-
160-
})() ?? "light";
161-
*/
162-
163-
const colorScheme = (() => {
164-
const cookie = appContext.ctx.req?.headers.cookie;
165-
166-
return cookie === undefined ? undefined : readColorSchemeInCookie(cookie);
167-
})();
168-
169-
console.log(
170-
"(server) App.getInitialProps, we read the colorScheme from cookie: ",
171-
colorScheme
172-
);
153+
$colorScheme.current =
154+
(() => {
155+
const cookie = appContext.ctx.req?.headers.cookie;
173156

174-
$colorScheme.current = colorScheme ?? "light";
157+
return cookie === undefined ? undefined : readColorSchemeInCookie(cookie);
158+
})() ?? "light";
175159
}
176160

177161
return { ...initialProps };

0 commit comments

Comments
 (0)