Skip to content

Create polished demo videos without editing skills. Mac/Windows/Linux

fix(whisper): reset download state on model deletion failure

webadderalla114f5b05f6c
diff --git a/electron/ipc/handlers.ts b/electron/ipc/handlers.ts
index 4a08447b..bebe9c4d 100644
--- a/electron/ipc/handlers.ts
+++ b/electron/ipc/handlers.ts
@@ -5691,6 +5691,23 @@ body{background:transparent;overflow:hidden;width:100vw;height:100vh}
return { success: true }
} catch (error) {
console.error('Failed to delete Whisper small model:', error)
+ // Verify whether the file was actually removed despite the error
+ const status = await getWhisperSmallModelStatus()
+ if (!status.exists) {
+ // File is gone — treat as success
+ sendWhisperModelDownloadProgress(event.sender, {
+ status: 'idle',
+ progress: 0,
+ path: null,
+ })
+ return { success: true }
+ }
+ sendWhisperModelDownloadProgress(event.sender, {
+ status: 'error',
+ progress: 0,
+ path: null,
+ error: String(error),
+ })
return { success: false, error: String(error) }
}
})
diff --git a/src/components/video-editor/VideoEditor.tsx b/src/components/video-editor/VideoEditor.tsx
index 0bd6b7f3..b2239db4 100644
--- a/src/components/video-editor/VideoEditor.tsx
+++ b/src/components/video-editor/VideoEditor.tsx
@@ -5,6 +5,7 @@ import {
Download,
FolderOpen,
MousePointer2,
+ Puzzle,
Redo2,
Save,
Sparkles,
@@ -1815,6 +1816,9 @@ export default function VideoEditor() {
const result = await window.electronAPI.deleteWhisperSmallModel();
if (!result.success) {
toast.error(result.error || "Failed to delete Whisper small model");
+ // Reset download state so re-download is not blocked
+ setWhisperModelDownloadStatus("idle");
+ setWhisperModelDownloadProgress(0);
return;
}