Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5cce470850 | ||
|
|
ffc3cbb4a9 |
7
docs/releases/1.5.1.md
Normal file
7
docs/releases/1.5.1.md
Normal file
@@ -0,0 +1,7 @@
|
||||
# 1.5.1
|
||||
|
||||
## 体验优化
|
||||
|
||||
- User 用户登录后立即进入应用,更新检查和下载在后台运行。
|
||||
- 下载完成后自动显示更新提示,整个过程对用户透明。
|
||||
- 优化登录流程体验,消除更新下载导致的阻塞时间。
|
||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "erpauto",
|
||||
"version": "1.5.0",
|
||||
"version": "1.5.1",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "erpauto",
|
||||
"version": "1.5.0",
|
||||
"version": "1.5.1",
|
||||
"hasInstallScript": true,
|
||||
"dependencies": {
|
||||
"@aws-sdk/client-s3": "^3.929.0",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "erpauto",
|
||||
"version": "1.5.0",
|
||||
"version": "1.5.1",
|
||||
"description": "An Electron application with React and TypeScript",
|
||||
"main": "./out/main/index.js",
|
||||
"author": "example.com",
|
||||
|
||||
@@ -124,7 +124,12 @@ export class UpdateService {
|
||||
return
|
||||
}
|
||||
|
||||
await this.checkForUpdates()
|
||||
// 启动异步更新检查,不阻塞登录流程
|
||||
void this.checkForUpdates().catch((error) => {
|
||||
log.warn('Async update check failed', {
|
||||
error: error instanceof Error ? error.message : String(error)
|
||||
})
|
||||
})
|
||||
this.startPolling()
|
||||
}
|
||||
|
||||
@@ -149,16 +154,16 @@ export class UpdateService {
|
||||
this.publishStatus(nextStatus)
|
||||
|
||||
if (nextStatus.phase === 'available' && nextStatus.recommendedRelease) {
|
||||
try {
|
||||
await this.downloadRelease(nextStatus.recommendedRelease)
|
||||
} catch (error) {
|
||||
// 异步下载,不阻塞更新检查流程
|
||||
void this.downloadRelease(nextStatus.recommendedRelease).catch((error) => {
|
||||
const message = error instanceof Error ? error.message : '下载更新失败'
|
||||
log.warn('Async update download failed', { error: message })
|
||||
this.publishStatus({
|
||||
phase: 'error',
|
||||
error: message,
|
||||
message
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
} else if (currentUserType === 'Admin') {
|
||||
this.publishStatus(this.catalogService.resolveAdminStatus(this.status, this.catalog))
|
||||
|
||||
Reference in New Issue
Block a user