fix: Improve Whisper model status error handling

- Set sidecarReady to false when model_error is received
- Store error message in activeWhisperConfig for status display
- Update frontend to show error state with red indicator
- Prevents showing  when model failed to load

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
egg
2025-12-18 11:46:51 +08:00
parent 0defc829dd
commit c05fdad8e4
2 changed files with 20 additions and 7 deletions

View File

@@ -434,9 +434,15 @@ function startSidecar() {
mainWindow.webContents.send("model-download-progress", msg);
}
// Forward model error status
if (msg.status === "model_error" && mainWindow) {
mainWindow.webContents.send("model-download-progress", msg);
// Forward model error status and mark sidecar as not ready
if (msg.status === "model_error") {
sidecarReady = false;
if (activeWhisperConfig) {
activeWhisperConfig.error = msg.error || "Model load failed";
}
if (mainWindow) {
mainWindow.webContents.send("model-download-progress", msg);
}
}
} catch (e) {
console.log("Sidecar output:", line);