diff options
Diffstat (limited to 'src/stores')
| -rw-r--r-- | src/stores/roundDownChapters.ts | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/stores/roundDownChapters.ts b/src/stores/roundDownChapters.ts new file mode 100644 index 00000000..f4ac3513 --- /dev/null +++ b/src/stores/roundDownChapters.ts @@ -0,0 +1,14 @@ +import { browser } from '$app/environment'; +import { writable } from 'svelte/store'; + +const roundDownChapters = writable<string>( + browser ? localStorage.getItem('roundDownChapters') ?? 'false' : 'false' +); + +roundDownChapters.subscribe((value) => { + if (browser) { + localStorage.setItem('roundDownChapters', value); + } +}); + +export default roundDownChapters; |