mirror of
https://github.com/sussy-code/smov.git
synced 2024-12-29 16:07:40 +01:00
Fix dumb mistake
This commit is contained in:
parent
c935ee160b
commit
0126b52490
1 changed files with 1 additions and 23 deletions
|
@ -1,5 +1,5 @@
|
|||
import classNames from "classnames";
|
||||
import React, { useState, useEffect, useCallback } from "react";
|
||||
import React, { useCallback, useEffect, useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
import { Icon, Icons } from "@/components/Icon";
|
||||
|
@ -19,11 +19,6 @@ function shouldShowNextEpisodeButton(
|
|||
return "none";
|
||||
}
|
||||
|
||||
function shouldStartCountdown(time: number, duration: number): boolean {
|
||||
const secondsFromEnd = duration - time;
|
||||
return secondsFromEnd <= 30 || time / duration >= 0.93;
|
||||
}
|
||||
|
||||
function Button(props: {
|
||||
className: string;
|
||||
onClick?: () => void;
|
||||
|
@ -113,23 +108,6 @@ export function NextEpisodeButton(props: {
|
|||
if (!meta?.episode || !nextEp) return null;
|
||||
if (metaType !== "show") return null;
|
||||
|
||||
const [seconds, setSeconds] = useState(15);
|
||||
|
||||
useEffect(() => {
|
||||
const interval = setInterval(() => {
|
||||
setSeconds((prevSeconds) => prevSeconds - 1);
|
||||
}, 1000);
|
||||
|
||||
return () => clearInterval(interval);
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
if (seconds === 0) {
|
||||
loadNextEpisode();
|
||||
setSeconds(15);
|
||||
}
|
||||
}, [seconds, loadNextEpisode]);
|
||||
|
||||
return (
|
||||
<Transition
|
||||
animation={animation}
|
||||
|
|
Loading…
Reference in a new issue