mirror of
https://github.com/sussy-code/smov.git
synced 2025-01-02 16:37:39 +01:00
updated selectLanguage callback to call selectCaptionById after searching for correct caption
This commit is contained in:
parent
32dd68c90e
commit
f09a185335
1 changed files with 2 additions and 10 deletions
|
@ -35,17 +35,9 @@ export function useCaptions() {
|
||||||
async (language: string) => {
|
async (language: string) => {
|
||||||
const caption = captionList.find((v) => v.language === language);
|
const caption = captionList.find((v) => v.language === language);
|
||||||
if (!caption) return;
|
if (!caption) return;
|
||||||
const srtData = await downloadCaption(caption);
|
selectCaptionById(caption.id);
|
||||||
setCaption({
|
|
||||||
id: caption.id,
|
|
||||||
language: caption.language,
|
|
||||||
srtData,
|
|
||||||
url: caption.url,
|
|
||||||
});
|
|
||||||
resetSubtitleSpecificSettings();
|
|
||||||
setLanguage(language);
|
|
||||||
},
|
},
|
||||||
[setLanguage, captionList, setCaption, resetSubtitleSpecificSettings],
|
[captionList, selectCaptionById],
|
||||||
);
|
);
|
||||||
|
|
||||||
const disable = useCallback(async () => {
|
const disable = useCallback(async () => {
|
||||||
|
|
Loading…
Reference in a new issue