aboutsummaryrefslogtreecommitdiff
path: root/src/lib/List/Manga
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/List/Manga')
-rw-r--r--src/lib/List/Manga/MangaListTemplate.svelte18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/lib/List/Manga/MangaListTemplate.svelte b/src/lib/List/Manga/MangaListTemplate.svelte
index 2e625569..d1bc2633 100644
--- a/src/lib/List/Manga/MangaListTemplate.svelte
+++ b/src/lib/List/Manga/MangaListTemplate.svelte
@@ -1,6 +1,6 @@
<script lang="ts">
import { mediaListCollection, Type, type Media } from '$lib/AniList/media';
- import type { UserIdentity, AniListAuthorisation } from '$lib/AniList/identity';
+ import type { AniListAuthorisation } from '$lib/AniList/identity';
import { onDestroy, onMount } from 'svelte';
import { chapterCount } from '$lib/Media/Manga/chapters';
import { pruneAllManga } from '$lib/Media/Manga/cache';
@@ -18,14 +18,14 @@
import Skeleton from '$lib/Loading/Skeleton.svelte';
import locale from '$stores/locale';
import { browser } from '$app/environment';
+ import identity from '$stores/identity';
export let user: AniListAuthorisation;
- export let identity: UserIdentity;
export let displayUnresolved: boolean;
export let due: boolean;
const { addNotification } = getNotificationsContext();
- const authorised = authorisedJson.includes(identity.id);
+ const authorised = authorisedJson.includes($identity.id);
let mangaLists: Promise<Media[]>;
let startTime: number;
let endTime: number;
@@ -40,7 +40,7 @@
const keyCacher = setInterval(() => {
startTime = performance.now();
endTime = -1;
- mangaLists = mediaListCollection(user, identity, Type.Manga, $manga, $lastPruneTimes.manga, {
+ mangaLists = mediaListCollection(user, $identity, Type.Manga, $manga, $lastPruneTimes.manga, {
addNotification
});
}, $settings.cacheMinutes * 1000 * 60);
@@ -53,7 +53,7 @@
}
startTime = performance.now();
- mangaLists = mediaListCollection(user, identity, Type.Manga, $manga, $lastPruneTimes.manga, {
+ mangaLists = mediaListCollection(user, $identity, Type.Manga, $manga, $lastPruneTimes.manga, {
addNotification
});
});
@@ -119,14 +119,14 @@
if (!due) return new Promise((resolve) => resolve(m.chapters)) as Promise<number | null>;
- if (c !== undefined) return chapterCount(identity, m, $settings.calculateGuessingDisabled);
+ if (c !== undefined) return chapterCount($identity, m, $settings.calculateGuessingDisabled);
else {
// A = On 1 second interval,
// B = a maximum of 5 requests per second are allowed.
// C = chapterCount makes 3 requests per call.
// F = A / (B / C) = 0.6 seconds
return new Promise((resolve) => setTimeout(resolve, 600)).then(() =>
- chapterCount(identity, m, $settings.calculateGuessingDisabled)
+ chapterCount($identity, m, $settings.calculateGuessingDisabled)
);
}
})
@@ -188,7 +188,7 @@
if (foundEntry && foundEntry.mediaListEntry)
foundEntry.mediaListEntry.progress = (progress || 0) + 1;
- mangaLists = mediaListCollection(user, identity, Type.Manga, $manga, $lastPruneTimes.manga, {
+ mangaLists = mediaListCollection(user, $identity, Type.Manga, $manga, $lastPruneTimes.manga, {
forcePrune: true
});
pendingUpdate = null;
@@ -200,7 +200,7 @@
endTime = -1;
pruneAllManga().then(() => {
- mangaLists = mediaListCollection(user, identity, Type.Manga, $manga, $lastPruneTimes.manga, {
+ mangaLists = mediaListCollection(user, $identity, Type.Manga, $manga, $lastPruneTimes.manga, {
forcePrune: true
});
});