fix: online fix totalPages becoming NaN

This commit is contained in:
Zamitto 2024-05-17 16:19:59 -03:00
parent d3d9315102
commit 4b0f998830

View file

@ -14,6 +14,8 @@ import { formatBytes } from "@shared";
const ONLINE_FIX_URL = "https://online-fix.me/"; const ONLINE_FIX_URL = "https://online-fix.me/";
let totalPages = 1;
export const getNewRepacksFromOnlineFix = async ( export const getNewRepacksFromOnlineFix = async (
existingRepacks: Repack[] = [], existingRepacks: Repack[] = [],
page = 1, page = 1,
@ -70,9 +72,12 @@ export const getNewRepacksFromOnlineFix = async (
const repacks: QueryDeepPartialEntity<Repack>[] = []; const repacks: QueryDeepPartialEntity<Repack>[] = [];
const articles = Array.from(document.querySelectorAll(".news")); const articles = Array.from(document.querySelectorAll(".news"));
const totalPages = Number(
document.querySelector("nav > a:nth-child(13)")?.textContent if (page == 1) {
); totalPages = Number(
document.querySelector("nav > a:nth-child(13)")?.textContent
);
}
try { try {
await Promise.all( await Promise.all(