From af5ee0299db5c70e8f480b09e66f3968c1e7e8eb Mon Sep 17 00:00:00 2001 From: chyoo Date: Mon, 12 Oct 2026 17:51:59 +0900 Subject: [PATCH] fix(launcher): stabilize remote connection and optimize update progress --- package.json | 2 +- src/main/index.ts | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index fb92d07..678cb6c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "autonomy-studio-launcher", - "version": "1.1.4", + "version": "1.1.5", "description": "Autonomy Studio v2 Frontend", "main": "./out/main/index.js", "author": { diff --git a/src/main/index.ts b/src/main/index.ts index 342b317..d29fbe4 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -350,12 +350,17 @@ function downloadFile( const total = Number(response.headers['content-length'] ?? 0) let received = 0 + let lastProgress = -1 const file = createWriteStream(tmpPath) response.on('data', (chunk: Buffer) => { received += chunk.length if (total > 0) { - onProgress(Math.min(99, Math.round((received / total) * 100))) + const progress = Math.min(99, Math.round((received / total) * 100)) + if (progress !== lastProgress) { + lastProgress = progress + onProgress(progress) + } } })