From d84f03ee7757d0f27a24c2f8fd685476aed2daa4 Mon Sep 17 00:00:00 2001 From: Robonau <30987265+Robonau@users.noreply.github> Date: Thu, 24 Oct 2024 11:00:57 +0100 Subject: [PATCH 1/2] versionToServerVersionMapping --- versionToServerVersionMapping.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versionToServerVersionMapping.json b/versionToServerVersionMapping.json index 8e63e3d..0cbef2b 100644 --- a/versionToServerVersionMapping.json +++ b/versionToServerVersionMapping.json @@ -5,7 +5,7 @@ }, { "tag": "v1.1.0", - "uiVersion": "r1153", + "uiVersion": "r1162", "serverVersion": "r1502", "comment": "the server version is between 1.0.0 and 1.1.0 release", "comment2": "because its the preview version that implemented the breaking changes" From 6674c26de35c99058d5796e83a18da2db4d29e09 Mon Sep 17 00:00:00 2001 From: Robonau <30987265+Robonau@users.noreply.github> Date: Fri, 25 Oct 2024 00:36:23 +0100 Subject: [PATCH 2/2] fix tracking --- .../manga/[MangaID]/(manga)/InfoSide.svelte | 4 +-- .../[MangaID]/(manga)/TrackingModal.svelte | 34 +++++++++++-------- .../chapter/[ChapterID]/chapterDrawer.svelte | 5 +-- 3 files changed, 25 insertions(+), 18 deletions(-) diff --git a/src/routes/(app)/manga/[MangaID]/(manga)/InfoSide.svelte b/src/routes/(app)/manga/[MangaID]/(manga)/InfoSide.svelte index caf44f6..1a8d5c8 100644 --- a/src/routes/(app)/manga/[MangaID]/(manga)/InfoSide.svelte +++ b/src/routes/(app)/manga/[MangaID]/(manga)/InfoSide.svelte @@ -20,7 +20,7 @@ type OperationResultStore, type Pausable } from '@urql/svelte'; - import { type ResultOf } from '$lib/gql/graphql'; + import type { ResultOf } from '$lib/gql/graphql'; import { deleteDownloadedChapters, dequeueChapterDownloads, @@ -286,7 +286,7 @@ modalStore.trigger({ type: 'component', backdropClasses: '!p-0', - component: { ref: TrackingModal, props: { manga } } + component: { ref: TrackingModal, props: { manga: manga2 } } }); }} class="variant-soft btn flex h-12 items-center px-2 sm:px-5" diff --git a/src/routes/(app)/manga/[MangaID]/(manga)/TrackingModal.svelte b/src/routes/(app)/manga/[MangaID]/(manga)/TrackingModal.svelte index 8ca2e7b..5cd5b80 100644 --- a/src/routes/(app)/manga/[MangaID]/(manga)/TrackingModal.svelte +++ b/src/routes/(app)/manga/[MangaID]/(manga)/TrackingModal.svelte @@ -28,7 +28,7 @@ import IconButton from '$lib/components/IconButton.svelte'; interface Props { - manga: OperationResultStore> & Pausable; + manga: OperationResultStore>; } let { manga }: Props = $props(); @@ -42,18 +42,24 @@ | (OperationResultStore> & Pausable) | undefined = $state(); - const Trackers = queryStore({ + const Trackers2 = queryStore({ client, query: trackers, variables: { isLoggedIn: true }, requestPolicy: 'network-only' }); - $manga.data?.manga?.trackRecords.nodes.forEach((e) => { - mutationStore({ - client, - query: fetchTrack, - variables: { recordId: e.id } + let Trackers = $derived.by(() => { + return $state.snapshot($Trackers2); + }); + + $effect(() => { + $manga.data?.manga?.trackRecords.nodes.forEach((e) => { + mutationStore({ + client, + query: fetchTrack, + variables: { recordId: e.id } + }); }); }); @@ -125,13 +131,13 @@

Tracking

- {#if $Trackers.fetching} + {#if Trackers.fetching} Loading... - {:else if $Trackers.error} + {:else if Trackers.error}
- {JSON.stringify($Trackers.error, null, 4)} + {JSON.stringify(Trackers.error, null, 4)}
- {:else if $Trackers.data?.trackers.nodes.length} + {:else if Trackers.data?.trackers.nodes.length}
Tracking - {#each $Trackers.data.trackers.nodes as tracke} + {#each Trackers.data.trackers.nodes as tracke (tracke.id)} {@const tracker = tracke} {tracker.name} @@ -154,9 +160,9 @@ {#if tabSet === 'Tracking'} {@const Records = $manga.data?.manga?.trackRecords.nodes ?? []} - {@const tracks = $Trackers.data?.trackers.nodes} + {@const tracks = Trackers.data?.trackers.nodes}
- {#each Records as RecordItem} + {#each Records as RecordItem (RecordItem.id)} {@const track = tracks.find( (e) => e.id === RecordItem.trackerId )} diff --git a/src/routes/(app)/manga/[MangaID]/chapter/[ChapterID]/chapterDrawer.svelte b/src/routes/(app)/manga/[MangaID]/chapter/[ChapterID]/chapterDrawer.svelte index d1dc9a8..605f5e3 100644 --- a/src/routes/(app)/manga/[MangaID]/chapter/[ChapterID]/chapterDrawer.svelte +++ b/src/routes/(app)/manga/[MangaID]/chapter/[ChapterID]/chapterDrawer.svelte @@ -80,8 +80,9 @@ }); const _ = [mangaMeta, $manga]; const tmp = untrack(() => { - return $manga.data?.manga.chapters.nodes - .filter(filterChapters(mangaMeta, true)) + return $state + .snapshot($manga) + .data?.manga.chapters.nodes.filter(filterChapters(mangaMeta, true)) .sort((a, b) => { return b.sourceOrder - a.sourceOrder; });