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