Skip to content

Commit

Permalink
Merge pull request #101 from Suwayomi/main
Browse files Browse the repository at this point in the history
migrate tracking
  • Loading branch information
Robonau authored Nov 28, 2023
2 parents 59f9407 + 5d82e8b commit 971db47
Showing 1 changed file with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
type GetMangaQuery,
type UpdateMangaCategoriesMutation
} from '$lib/generated';
import { MangaMeta } from '$lib/simpleStores';
import type { ApolloCache, FetchResult } from '@apollo/client';
import { ProgressRadial, getModalStore } from '@skeletonlabs/skeleton';
import type { SvelteComponent } from 'svelte';
Expand All @@ -24,9 +25,11 @@
let doChapters = true;
let doCategories = true;
let doTracking = true;
let MigrateLoading = false;
let CopyLoading = false;
const mangaMeta = MangaMeta(id);
async function MigrateManga() {
MigrateLoading = true;
Expand Down Expand Up @@ -55,6 +58,9 @@
if (doCategories) {
await CopyMangaCategories();
}
if (doTracking) {
await CopyMangaTracking();
}
parent.onClose();
}
Expand Down Expand Up @@ -232,6 +238,12 @@
update: (a, b) => updateMangaCategoriesUpdate(a, b, dat)
});
}
async function CopyMangaTracking() {
$mangaMeta.mangaUpdatesSeriesID =
JSON.parse(manga.meta.find((e) => e.key === 'VUI3_mangaUpdatesSeriesID')?.value ?? 'null') ??
null;
}
</script>

{#if $modalStore[0]}
Expand All @@ -245,6 +257,9 @@
<Slide class="outline-0 p-1 pl-2 hover:variant-glass-surface" bind:checked={doCategories}>
Categories
</Slide>
<Slide class="outline-0 p-1 pl-2 hover:variant-glass-surface" bind:checked={doTracking}>
Tracking
</Slide>
</div>
</div>
<div class="p-4 flex justify-between">
Expand All @@ -268,7 +283,7 @@
class="btn variant-filled-surface hover:variant-glass-surface"
>
{#if MigrateLoading}
MigratIng<ProgressRadial class="ml-1 h-4 aspect-square w-auto" />
Migrating<ProgressRadial class="ml-1 h-4 aspect-square w-auto" />
{:else}
Migrate
{/if}
Expand Down

0 comments on commit 971db47

Please sign in to comment.