Skip to content

Commit

Permalink
fix: use sessionStorage storeColorScheme, fix #444
Browse files Browse the repository at this point in the history
  • Loading branch information
Akryum committed Feb 10, 2023
1 parent 6ea5bbe commit b3c836d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/histoire-app/src/app/util/dark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import { histoireConfig } from './config.js'
export const isDark = useDark({
valueDark: 'htw-dark',
initialValue: histoireConfig.theme.defaultColorScheme,
storageKey: histoireConfig.theme.storeColorScheme ? 'histoire-color-scheme' : null,
storageKey: 'histoire-color-scheme',
storage: histoireConfig.theme.storeColorScheme ? localStorage : sessionStorage,
})
export const toggleDark = useToggle(isDark)

Expand Down

0 comments on commit b3c836d

Please sign in to comment.