Skip to content

Commit

Permalink
try a lil sum
Browse files Browse the repository at this point in the history
  • Loading branch information
itzCozi committed Mar 25, 2024
1 parent d4fbaca commit 33e7de1
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions src/pages/parts/player/ScrapingPart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,23 +61,17 @@ export function ScrapingPart(props: ScrapingProps) {
}, [sourceOrder, sources]);

const timeoutRef = useRef<NodeJS.Timeout | null>(null);

Check warning on line 63 in src/pages/parts/player/ScrapingPart.tsx

View workflow job for this annotation

GitHub Actions / Build project

'timeoutRef' is assigned a value but never used. Allowed unused vars must match /^_/u

Check warning on line 63 in src/pages/parts/player/ScrapingPart.tsx

View workflow job for this annotation

GitHub Actions / Run Linters

'timeoutRef' is assigned a value but never used. Allowed unused vars must match /^_/u
const TIMEOUT_DURATION = 2000; // 2 seconds
const TIMEOUT_DURATION = 2000; // 60 seconds

useEffect(() => {
if (timeoutRef.current) {
clearTimeout(timeoutRef.current);
}

timeoutRef.current = setTimeout(() => {
window.location.reload();
const timeout = setTimeout(() => {
console.log("Shit went wrong..."); // setFailedStartScrape(true);

Check warning on line 68 in src/pages/parts/player/ScrapingPart.tsx

View workflow job for this annotation

GitHub Actions / Build project

Unexpected console statement

Check warning on line 68 in src/pages/parts/player/ScrapingPart.tsx

View workflow job for this annotation

GitHub Actions / Run Linters

Unexpected console statement
}, TIMEOUT_DURATION);

return () => {
if (timeoutRef.current) {
clearTimeout(timeoutRef.current);
}
clearTimeout(timeout);
};
}, [currentSource, sourceOrder]);
}, [startScraping, props, report, isMounted]);

const started = useRef(false);
useEffect(() => {
Expand Down

0 comments on commit 33e7de1

Please sign in to comment.