diff --git a/src/routes/(app)/manga/[MangaID]/chapter/[ChapterID]/+layout@.svelte b/src/routes/(app)/manga/[MangaID]/chapter/[ChapterID]/+layout@.svelte index b778a3ec..51e61771 100644 --- a/src/routes/(app)/manga/[MangaID]/chapter/[ChapterID]/+layout@.svelte +++ b/src/routes/(app)/manga/[MangaID]/chapter/[ChapterID]/+layout@.svelte @@ -9,6 +9,7 @@ import { MangaMetaWritable, ChapterTitles, type MangaMetaClass } from '$lib/MangaMeta'; import { boolInitMeta, strInitMeta, Meta } from '$lib/MetaStore'; import { paths } from './paths'; + import { get } from 'svelte/store'; let swapactive = false; let title = 'title Placeholder...'; let Chaptername = 'Chapter name Placeholder...'; @@ -27,14 +28,12 @@ let defoffset = false; Meta.then((met) => { - const unsub = met.subscribe((e) => { - defmode = strInitMeta(e, 'mode', 'vertical'); - defnav = strInitMeta(e, 'nav', 'L'); - defmargins = boolInitMeta(e, 'margins', false); - defscale = boolInitMeta(e, 'scale', false); - defoffset = boolInitMeta(e, 'offset', false); - }); - unsub(); + const e = get(met); + defmode = strInitMeta(e, 'mode', 'vertical'); + defnav = strInitMeta(e, 'nav', 'L'); + defmargins = boolInitMeta(e, 'margins', false); + defscale = boolInitMeta(e, 'scale', false); + defoffset = boolInitMeta(e, 'offset', false); }); $: Unsubscriber = MangaMetaClass?.MangaMeta.subscribe((val) => { const tmpp = strInitMeta(val, 'mode', defmode); diff --git a/src/routes/(app)/manga/[MangaID]/chapter/[ChapterID]/+page.svelte b/src/routes/(app)/manga/[MangaID]/chapter/[ChapterID]/+page.svelte index 7d41cfee..7a0fd1fd 100644 --- a/src/routes/(app)/manga/[MangaID]/chapter/[ChapterID]/+page.svelte +++ b/src/routes/(app)/manga/[MangaID]/chapter/[ChapterID]/+page.svelte @@ -17,6 +17,7 @@ import { goto } from '$app/navigation'; import { paths, type Tpath } from './paths'; import { navOptions, type modeop, type navop, modeOptions } from '$lib/Options'; + import { get } from 'svelte/store'; const mangaID = parseInt(data.MangaID); let CurrChapterID = parseInt(data.ChapterID); @@ -127,28 +128,25 @@ const MangaMetaClas = new MangaMetaClass(structuredClone(e.data.manga.meta), mangaID); Meta.then((met) => { - const unsub = met.subscribe((e) => { - defmode = strInitMeta(e, 'mode', 'vertical'); - defnav = strInitMeta(e, 'nav', 'L'); - defmargins = boolInitMeta(e, 'margins', false); - defscale = boolInitMeta(e, 'scale', false); - defoffset = boolInitMeta(e, 'offset', false); - - MangaMetaClas.MangaMeta.subscribe((val) => { - const tmpp = strInitMeta(val, 'mode', defmode); - if (modeOptions.find((ele) => ele.value === tmpp)) { - mode = tmpp as modeop; - } - const tmp = strInitMeta(val, 'nav', defnav); - if (navOptions.find((ele) => ele.value === tmp)) { - nav = tmp as navop; - } - margins = boolInitMeta(val, 'margins', defmargins); - scale = boolInitMeta(val, 'scale', defscale); - offset = boolInitMeta(val, 'offset', defoffset); - }); + const e = get(met); + defmode = strInitMeta(e, 'mode', 'vertical'); + defnav = strInitMeta(e, 'nav', 'L'); + defmargins = boolInitMeta(e, 'margins', false); + defscale = boolInitMeta(e, 'scale', false); + defoffset = boolInitMeta(e, 'offset', false); + MangaMetaClas.MangaMeta.subscribe((val) => { + const tmpp = strInitMeta(val, 'mode', defmode); + if (modeOptions.find((ele) => ele.value === tmpp)) { + mode = tmpp as modeop; + } + const tmp = strInitMeta(val, 'nav', defnav); + if (navOptions.find((ele) => ele.value === tmp)) { + nav = tmp as navop; + } + margins = boolInitMeta(val, 'margins', defmargins); + scale = boolInitMeta(val, 'scale', defscale); + offset = boolInitMeta(val, 'offset', defoffset); }); - unsub(); }); });