diff options
| author | Fuwn <[email protected]> | 2023-12-28 20:48:32 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2023-12-28 20:48:32 -0800 |
| commit | 63616858875e3ba9acec9752fb634bb9a82d6e6d (patch) | |
| tree | 18f46c3d39a8b0b989750d79b85aa2a67b1ae056 /src/lib/Media | |
| parent | feat(list): hover cover (diff) | |
| download | due.moe-63616858875e3ba9acec9752fb634bb9a82d6e6d.tar.xz due.moe-63616858875e3ba9acec9752fb634bb9a82d6e6d.zip | |
refactor(hovercover): move skip to module
Diffstat (limited to 'src/lib/Media')
| -rw-r--r-- | src/lib/Media/hoverCover.ts | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/lib/Media/hoverCover.ts b/src/lib/Media/hoverCover.ts index 29d2df46..aeb1b571 100644 --- a/src/lib/Media/hoverCover.ts +++ b/src/lib/Media/hoverCover.ts @@ -1,5 +1,7 @@ import type { Media } from '$lib/AniList/media'; +import { get } from 'svelte/store'; import type { SubsPleaseEpisode } from './Anime/Airing/Subtitled/subsPlease'; +import settings from '../../stores/settings'; interface OnMouseEnterLeave { hovering: boolean; @@ -8,6 +10,9 @@ interface OnMouseEnterLeave { } export const onMouseEnter = (media: Media | null, item: SubsPleaseEpisode | null = null) => { + if (!get(settings).displayHoverCover && !item) + return { hovering: false, item: null, media: null } as OnMouseEnterLeave; + return { hovering: true, item, media } as OnMouseEnterLeave; }; |