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 classNames from "classnames";
|
||||||
import React, { useState, useEffect, useCallback } from "react";
|
import React, { useCallback, useEffect, useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
import { Icon, Icons } from "@/components/Icon";
|
import { Icon, Icons } from "@/components/Icon";
|
||||||
|
@ -19,11 +19,6 @@ function shouldShowNextEpisodeButton(
|
||||||
return "none";
|
return "none";
|
||||||
}
|
}
|
||||||
|
|
||||||
function shouldStartCountdown(time: number, duration: number): boolean {
|
|
||||||
const secondsFromEnd = duration - time;
|
|
||||||
return secondsFromEnd <= 30 || time / duration >= 0.93;
|
|
||||||
}
|
|
||||||
|
|
||||||
function Button(props: {
|
function Button(props: {
|
||||||
className: string;
|
className: string;
|
||||||
onClick?: () => void;
|
onClick?: () => void;
|
||||||
|
@ -113,23 +108,6 @@ export function NextEpisodeButton(props: {
|
||||||
if (!meta?.episode || !nextEp) return null;
|
if (!meta?.episode || !nextEp) return null;
|
||||||
if (metaType !== "show") 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 (
|
return (
|
||||||
<Transition
|
<Transition
|
||||||
animation={animation}
|
animation={animation}
|
||||||
|
|
Loading…
Reference in a new issue