diff --git a/src/i18n/messages/ar.json b/src/i18n/messages/ar.json
index f2acd3b..bc4f199 100644
--- a/src/i18n/messages/ar.json
+++ b/src/i18n/messages/ar.json
@@ -172,6 +172,7 @@
"checking": "جارٍ التحقق...",
"checkUpdate": "التحقق من التحديثات",
"updating": "جارٍ التثبيت...",
+ "downloading": "جارٍ التنزيل...",
"upgradeTo": "الترقية إلى v{version}",
"foundUpdate": "تم العثور على إصدار جديد v{version}",
"alreadyLatest": "أنت على أحدث إصدار",
diff --git a/src/i18n/messages/de.json b/src/i18n/messages/de.json
index 46cd29e..ffc596a 100644
--- a/src/i18n/messages/de.json
+++ b/src/i18n/messages/de.json
@@ -172,6 +172,7 @@
"checking": "Wird geprüft...",
"checkUpdate": "Nach Updates suchen",
"updating": "Wird installiert...",
+ "downloading": "Herunterladen...",
"upgradeTo": "Auf v{version} aktualisieren",
"foundUpdate": "Neue Version v{version} gefunden",
"alreadyLatest": "Du verwendest bereits die neueste Version",
diff --git a/src/i18n/messages/en.json b/src/i18n/messages/en.json
index 1c8d77a..16e5f25 100644
--- a/src/i18n/messages/en.json
+++ b/src/i18n/messages/en.json
@@ -172,6 +172,7 @@
"checking": "Checking...",
"checkUpdate": "Check for updates",
"updating": "Installing...",
+ "downloading": "Downloading...",
"upgradeTo": "Upgrade to v{version}",
"foundUpdate": "New version v{version} found",
"alreadyLatest": "You're on the latest version",
diff --git a/src/i18n/messages/es.json b/src/i18n/messages/es.json
index ac84aec..0d72bff 100644
--- a/src/i18n/messages/es.json
+++ b/src/i18n/messages/es.json
@@ -172,6 +172,7 @@
"checking": "Comprobando...",
"checkUpdate": "Buscar actualizaciones",
"updating": "Instalando...",
+ "downloading": "Descargando...",
"upgradeTo": "Actualizar a v{version}",
"foundUpdate": "Nueva versión v{version} encontrada",
"alreadyLatest": "Ya tienes la versión más reciente",
diff --git a/src/i18n/messages/fr.json b/src/i18n/messages/fr.json
index c080d75..09b0f71 100644
--- a/src/i18n/messages/fr.json
+++ b/src/i18n/messages/fr.json
@@ -172,6 +172,7 @@
"checking": "Vérification...",
"checkUpdate": "Rechercher les mises à jour",
"updating": "Installation...",
+ "downloading": "Téléchargement...",
"upgradeTo": "Mettre à jour vers v{version}",
"foundUpdate": "Nouvelle version v{version} trouvée",
"alreadyLatest": "Vous utilisez déjà la dernière version",
diff --git a/src/i18n/messages/ja.json b/src/i18n/messages/ja.json
index c6a69c1..e4bf717 100644
--- a/src/i18n/messages/ja.json
+++ b/src/i18n/messages/ja.json
@@ -172,6 +172,7 @@
"checking": "確認中...",
"checkUpdate": "更新を確認",
"updating": "インストール中...",
+ "downloading": "ダウンロード中...",
"upgradeTo": "v{version} にアップグレード",
"foundUpdate": "新しいバージョン v{version} が見つかりました",
"alreadyLatest": "すでに最新バージョンです",
diff --git a/src/i18n/messages/ko.json b/src/i18n/messages/ko.json
index d50f148..6021a50 100644
--- a/src/i18n/messages/ko.json
+++ b/src/i18n/messages/ko.json
@@ -172,6 +172,7 @@
"checking": "확인 중...",
"checkUpdate": "업데이트 확인",
"updating": "설치 중...",
+ "downloading": "다운로드 중...",
"upgradeTo": "v{version}로 업그레이드",
"foundUpdate": "새 버전 v{version}을 찾았습니다",
"alreadyLatest": "이미 최신 버전입니다",
diff --git a/src/i18n/messages/pt.json b/src/i18n/messages/pt.json
index f432c1c..035225d 100644
--- a/src/i18n/messages/pt.json
+++ b/src/i18n/messages/pt.json
@@ -172,6 +172,7 @@
"checking": "Verificando...",
"checkUpdate": "Verificar atualizações",
"updating": "Instalando...",
+ "downloading": "Baixando...",
"upgradeTo": "Atualizar para v{version}",
"foundUpdate": "Nova versão v{version} encontrada",
"alreadyLatest": "Você já está na versão mais recente",
diff --git a/src/i18n/messages/zh-CN.json b/src/i18n/messages/zh-CN.json
index 5d76048..797a5b8 100644
--- a/src/i18n/messages/zh-CN.json
+++ b/src/i18n/messages/zh-CN.json
@@ -172,6 +172,7 @@
"checking": "检查中...",
"checkUpdate": "检查更新",
"updating": "升级中...",
+ "downloading": "下载中...",
"upgradeTo": "升级到 v{version}",
"foundUpdate": "发现新版本 v{version}",
"alreadyLatest": "当前已经是最新版本",
diff --git a/src/i18n/messages/zh-TW.json b/src/i18n/messages/zh-TW.json
index 3c59d03..b6e53cf 100644
--- a/src/i18n/messages/zh-TW.json
+++ b/src/i18n/messages/zh-TW.json
@@ -172,6 +172,7 @@
"checking": "檢查中...",
"checkUpdate": "檢查更新",
"updating": "升級中...",
+ "downloading": "下載中...",
"upgradeTo": "升級到 v{version}",
"foundUpdate": "發現新版本 v{version}",
"alreadyLatest": "目前已是最新版本",
diff --git a/src/lib/updater.ts b/src/lib/updater.ts
index dab70c3..64bfa67 100644
--- a/src/lib/updater.ts
+++ b/src/lib/updater.ts
@@ -4,6 +4,11 @@ import { getTransport, isDesktop } from "./transport"
// eslint-disable-next-line @typescript-eslint/no-explicit-any
type Update = any
+export type DownloadEvent =
+ | { event: "Started"; data: { contentLength?: number } }
+ | { event: "Progress"; data: { chunkLength: number } }
+ | { event: "Finished" }
+
export interface AppUpdateCheckResult {
currentVersion: string
update: Update | null
@@ -46,9 +51,10 @@ export async function checkAppUpdate(): Promise
{
}
export async function installAppUpdate(
- update: NonNullable
+ update: NonNullable,
+ onEvent?: (progress: DownloadEvent) => void
): Promise {
- await update.downloadAndInstall()
+ await update.downloadAndInstall(onEvent)
}
export async function relaunchApp(): Promise {