fix: dark mode flash if no cookie found (#779)
This commit is contained in:
@@ -16,3 +16,4 @@ export const MAXIMUM_FILE_SIZE = 100 // MB
|
||||
export const COLOR_SCHEME_DARK = "dark"
|
||||
export const COLOR_SCHEME_LIGHT = "light"
|
||||
export const DEFAULT_COLOR_SCHEME: ColorScheme = "light"
|
||||
export const DARK_MODE_STORAGE_KEY = "darkMode"
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { cookies } from "next/headers"
|
||||
|
||||
import { DEFAULT_COLOR_SCHEME } from "./constants"
|
||||
import { ColorScheme } from "./types"
|
||||
|
||||
export const getColorScheme = () =>
|
||||
(cookies().get("color_scheme")?.value || DEFAULT_COLOR_SCHEME) as ColorScheme
|
||||
cookies().get("color_scheme")?.value as ColorScheme
|
||||
|
||||
Reference in New Issue
Block a user