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