Skip to content

Voice-to-text dictation app with local (Nvidia Parakeet/Whisper) and cloud models (BYOK). Privacy-first and available cross-platform.

refactor: donwload pattern cleanups

Gabriel Steina8056ad10854
diff --git a/src/components/ControlPanel.tsx b/src/components/ControlPanel.tsx
index 4a85dc356..7e9345b5a 100644
--- a/src/components/ControlPanel.tsx
+++ b/src/components/ControlPanel.tsx
@@ -84,8 +84,10 @@ export default function ControlPanel() {
};
const handleDownloadProgress = (_event: any, progressObj: any) => {
- if (progressObj?.percent) {
- setDownloadProgress(Math.round(progressObj.percent));
+ if (progressObj?.percent != null) {
+ const newProgress = Math.round(progressObj.percent);
+ setDownloadProgress((prev) => (newProgress > prev ? newProgress : prev));
+ setIsDownloading(true);
}
};
@@ -304,7 +306,7 @@ export default function ControlPanel() {
variant={updateStatus.updateDownloaded ? "default" : "outline"}
size="sm"
onClick={handleUpdateClick}
- disabled={isInstalling}
+ disabled={isInstalling || isDownloading}
className={`gap-1.5 text-xs ${
updateStatus.updateDownloaded
? "bg-blue-600 hover:bg-blue-700 text-white"
diff --git a/src/updater.js b/src/updater.js
index c722ac03d..e509e3eca 100644
--- a/src/updater.js
+++ b/src/updater.js
@@ -181,14 +181,14 @@ class UpdateManager {
if (this.isDownloading) {
return {
- success: false,
+ success: true,
message: "Download already in progress",
};
}
if (this.updateDownloaded) {
return {
- success: false,
+ success: true,
message: "Update already downloaded. Ready to install.",
};
}