fix: download subtitle
This commit is contained in:
@@ -109,10 +109,6 @@ export function Menus({
|
|||||||
[updateSetting]
|
[updateSetting]
|
||||||
);
|
);
|
||||||
|
|
||||||
const handleDownload = useCallback(() => {
|
|
||||||
downloadSubtitle();
|
|
||||||
}, [downloadSubtitle]);
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const handler = (e) => {
|
const handler = (e) => {
|
||||||
const { action, data } = e.detail || {};
|
const { action, data } = e.detail || {};
|
||||||
@@ -169,7 +165,7 @@ export function Menus({
|
|||||||
/>
|
/>
|
||||||
<Button
|
<Button
|
||||||
label={`${status} [${progressed}%] `}
|
label={`${status} [${progressed}%] `}
|
||||||
onClick={handleDownload}
|
onClick={downloadSubtitle}
|
||||||
disabled={progressed !== 100}
|
disabled={progressed !== 100}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -206,7 +206,6 @@ class YouTubeCaptionProvider {
|
|||||||
downloadSubtitle() {
|
downloadSubtitle() {
|
||||||
if (!this.#subtitles.length || this.#progressed !== 100) {
|
if (!this.#subtitles.length || this.#progressed !== 100) {
|
||||||
logger.debug("Youtube Provider: The subtitle is not yet ready.");
|
logger.debug("Youtube Provider: The subtitle is not yet ready.");
|
||||||
this.#showNotification(this.#i18n("subtitle_is_not_yet_ready"));
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user