1
0
Fork 0
mirror of https://github.com/sussy-code/smov.git synced 2024-12-21 14:47:41 +01:00

updated selectLanguage callback to call selectCaptionById after searching for correct caption

This commit is contained in:
Ashutosh Shinde 2024-01-06 23:19:06 +05:30
parent 32dd68c90e
commit f09a185335

View file

@ -35,17 +35,9 @@ export function useCaptions() {
async (language: string) => {
const caption = captionList.find((v) => v.language === language);
if (!caption) return;
const srtData = await downloadCaption(caption);
setCaption({
id: caption.id,
language: caption.language,
srtData,
url: caption.url,
});
resetSubtitleSpecificSettings();
setLanguage(language);
selectCaptionById(caption.id);
},
[setLanguage, captionList, setCaption, resetSubtitleSpecificSettings],
[captionList, selectCaptionById],
);
const disable = useCallback(async () => {