From b8ad5ad8904534e0ddcca1c7253315c6fbdd901d Mon Sep 17 00:00:00 2001 From: Arief Rachmawan <62494292+mbahArip@users.noreply.github.com> Date: Sat, 5 Oct 2024 07:34:07 +0700 Subject: [PATCH] Fix: manga preview throw alwaysfaulty error --- src/components/Preview/Manga.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Preview/Manga.tsx b/src/components/Preview/Manga.tsx index 3a19367..ababbab 100644 --- a/src/components/Preview/Manga.tsx +++ b/src/components/Preview/Manga.tsx @@ -100,7 +100,7 @@ export default function PreviewManga({ file }: Props) { file.ondata = (err, data, final) => { if (err) throw err; // Check if the file is an image - if (!file.name.toLowerCase().includes(".jpg" || ".jpeg" || ".png" || ".gif" || ".webp")) return; + if (![".jpg", ".jpeg", ".png", ".gif", ".webp"].some(ext => file.name.toLowerCase().endsWith(ext))) return; if (!final) return; // Skip if not fully loaded const blob = new Blob([data]);