From 1e0dc85d558b61c14863bf38275b5038bac6abec Mon Sep 17 00:00:00 2001 From: Fuwn Date: Sun, 27 Aug 2023 17:27:43 -0700 Subject: fix(manga): pruning --- src/stores/chaptersLastPrune.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/stores/chaptersLastPrune.ts (limited to 'src/stores/chaptersLastPrune.ts') 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( + browser ? localStorage.getItem('chaptersLastPrune') ?? '' : '' +); + +chaptersLastPrune.subscribe((value) => { + if (browser) { + localStorage.setItem('chaptersLastPrune', value); + } +}); + +export default chaptersLastPrune; -- cgit v1.2.3