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:
parent
7efcf366f2
commit
fb8b8f1a9e
1 changed files with 7 additions and 1 deletions
|
@ -1,5 +1,5 @@
|
||||||
import classNames from "classnames";
|
import classNames from "classnames";
|
||||||
import React, { useCallback } from "react";
|
import React, { useCallback, useEffect } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
import { Icon, Icons } from "@/components/Icon";
|
import { Icon, Icons } from "@/components/Icon";
|
||||||
|
@ -80,6 +80,12 @@ export function NextEpisodeButton(props: {
|
||||||
props.onChange?.(metaCopy);
|
props.onChange?.(metaCopy);
|
||||||
}, [setDirectMeta, nextEp, meta, props, setShouldStartFromBeginning]);
|
}, [setDirectMeta, nextEp, meta, props, setShouldStartFromBeginning]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (time >= duration && meta && nextEp) {
|
||||||
|
loadNextEpisode();
|
||||||
|
}
|
||||||
|
}, [time, duration, meta, nextEp, loadNextEpisode]);
|
||||||
|
|
||||||
const startCurrentEpisodeFromBeginning = useCallback(() => {
|
const startCurrentEpisodeFromBeginning = useCallback(() => {
|
||||||
if (!meta || !meta.episode) return;
|
if (!meta || !meta.episode) return;
|
||||||
const metaCopy = { ...meta };
|
const metaCopy = { ...meta };
|
||||||
|
|
Loading…
Reference in a new issue