1
0
Fork 0
mirror of https://github.com/sussy-code/smov.git synced 2024-12-20 14:37:43 +01:00

Use peak debugging tech #1

This commit is contained in:
Cooper Ransom 2024-03-24 13:45:36 -04:00
parent 7efcf366f2
commit fb8b8f1a9e

View file

@ -1,5 +1,5 @@
import classNames from "classnames";
import React, { useCallback } from "react";
import React, { useCallback, useEffect } from "react";
import { useTranslation } from "react-i18next";
import { Icon, Icons } from "@/components/Icon";
@ -80,6 +80,12 @@ export function NextEpisodeButton(props: {
props.onChange?.(metaCopy);
}, [setDirectMeta, nextEp, meta, props, setShouldStartFromBeginning]);
useEffect(() => {
if (time >= duration && meta && nextEp) {
loadNextEpisode();
}
}, [time, duration, meta, nextEp, loadNextEpisode]);
const startCurrentEpisodeFromBeginning = useCallback(() => {
if (!meta || !meta.episode) return;
const metaCopy = { ...meta };