fix : download and loading

This commit is contained in:
Julien Froidefond
2025-03-16 21:20:09 +01:00
parent f5c581e799
commit d47da16014

View File

@@ -47,9 +47,11 @@ export function LoadingBar() {
window.fetch = async function (...args) {
const url = args[0].toString();
const isStaticRequest = /\.(css|js|png|jpg|jpeg|gif|webp|svg|ico|mp3|mp4|webm|ttf|woff|woff2)$/.test(url);
const isStaticRequest =
/\.(css|js|png|jpg|jpeg|gif|webp|svg|ico|mp3|mp4|webm|ttf|woff|woff2)$/.test(url);
const isBookPageRequest = url.includes("/api/komga/images/books/") && url.includes("/pages");
if (!isStaticRequest) {
if (!isStaticRequest && !isBookPageRequest) {
pendingRequestsRef.current++;
setIsLoading(true);
}
@@ -58,7 +60,7 @@ export function LoadingBar() {
const response = await originalFetch.apply(this, args);
return response;
} finally {
if (!isStaticRequest) {
if (!isStaticRequest && !isBookPageRequest) {
pendingRequestsRef.current = Math.max(0, pendingRequestsRef.current - 1);
if (pendingRequestsRef.current === 0) {