From 92293c66156e49f801fed6e8cc0996fd88f5f33b Mon Sep 17 00:00:00 2001 From: Fuwn Date: Sun, 3 Sep 2023 18:36:53 -0700 Subject: feat(settings): move last prune times to store --- src/lib/AniList/media.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/lib/AniList') diff --git a/src/lib/AniList/media.ts b/src/lib/AniList/media.ts index 034fccfd..ebf8c72f 100644 --- a/src/lib/AniList/media.ts +++ b/src/lib/AniList/media.ts @@ -2,9 +2,8 @@ import type { AniListAuthorisation } from '$lib/AniList/identity'; import type { UserIdentity } from './identity'; import anime from '../../stores/anime'; import manga from '../../stores/manga'; -import mangaLastPrune from '../../stores/mangaLastPrune'; -import animeLastPrune from '../../stores/animeLastPrune'; import settings from '../../stores/settings'; +import lastPruneTimes from '../../stores/lastPruneTimes'; export enum Type { Anime, @@ -69,9 +68,9 @@ export const mediaListCollection = async ( if (String(currentLastPruneAt) == '') { if (type === Type.Anime) { - animeLastPrune.set(new Date().getTime().toString()); + lastPruneTimes.setKey('anime', new Date().getTime().toString()); } else { - mangaLastPrune.set(new Date().getTime().toString()); + lastPruneTimes.setKey('manga', new Date().getTime().toString()); } } else { if ( @@ -80,10 +79,10 @@ export const mediaListCollection = async ( forcePrune ) { if (type === Type.Anime) { - animeLastPrune.set(new Date().getTime().toString()); + lastPruneTimes.setKey('anime', new Date().getTime().toString()); anime.set(''); } else { - mangaLastPrune.set(new Date().getTime().toString()); + lastPruneTimes.setKey('manga', new Date().getTime().toString()); manga.set(''); } -- cgit v1.2.3