MCPcopy Index your code
hub / github.com/ChatLab/ChatLab / startDownloadUpdate

Function startDownloadUpdate

apps/desktop/main/update.ts:135–150  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

133
134 // 自动检查走静默下载;手动检查仍由用户确认后再下载。
135 const startDownloadUpdate = (): void => {
136 if (isDownloadingUpdate) return
137 isDownloadingUpdate = true
138 autoUpdater
139 .downloadUpdate()
140 .then(() => {
141 console.log('wait for post download operation')
142 })
143 .catch((downloadError) => {
144 // 下载失败记录到日志,不显示给用户
145 logger.error(`[Update] Download update failed: ${downloadError}`)
146 })
147 .finally(() => {
148 isDownloadingUpdate = false
149 })
150 }
151
152 autoUpdater.on('update-available', (info) => {
153 // win.webContents.send('show-message', 'electron:发现新版本')

Callers 1

checkUpdateFunction · 0.85

Calls 2

downloadUpdateMethod · 0.80
errorMethod · 0.65

Tested by

no test coverage detected