mirror of
https://github.com/sussy-code/smov.git
synced 2024-12-29 16:07:40 +01:00
remove unnecesary eslint ignore
This commit is contained in:
parent
2657d1f856
commit
7a6af6c072
1 changed files with 10 additions and 4 deletions
|
@ -53,6 +53,11 @@ export function CaptionRendererAction({
|
||||||
const { captionSettings, setCaptionDelay } = useSettings();
|
const { captionSettings, setCaptionDelay } = useSettings();
|
||||||
const captions = useRef<ContentCaption[]>([]);
|
const captions = useRef<ContentCaption[]>([]);
|
||||||
|
|
||||||
|
const captionSetRef = useRef<(delay: number) => void>(setCaptionDelay);
|
||||||
|
useEffect(() => {
|
||||||
|
captionSetRef.current = setCaptionDelay;
|
||||||
|
}, [setCaptionDelay]);
|
||||||
|
|
||||||
useAsync(async () => {
|
useAsync(async () => {
|
||||||
const blobUrl = source?.caption?.url;
|
const blobUrl = source?.caption?.url;
|
||||||
if (blobUrl) {
|
if (blobUrl) {
|
||||||
|
@ -69,11 +74,12 @@ export function CaptionRendererAction({
|
||||||
captions.current = [];
|
captions.current = [];
|
||||||
}
|
}
|
||||||
}, [source?.caption?.url]);
|
}, [source?.caption?.url]);
|
||||||
|
|
||||||
|
// reset delay when loading new source url
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// reset delay after video ends
|
captionSetRef.current(0);
|
||||||
return () => setCaptionDelay(0);
|
}, [source?.caption?.url]);
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
||||||
}, []);
|
|
||||||
const isVisible = useCallback(
|
const isVisible = useCallback(
|
||||||
(
|
(
|
||||||
start: number,
|
start: number,
|
||||||
|
|
Loading…
Reference in a new issue