MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / downloadAppUpdate

Function downloadAppUpdate

apps/desktop/src/main/updater.ts:299–325  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

297}
298
299export async function downloadAppUpdate(): Promise<AppUpdateState> {
300 if (!updater || updateState.phase !== 'available') return getAppUpdateState()
301
302 setUpdateState(
303 nextStateFromInfo(
304 'downloading',
305 lastInfo,
306 `Downloading ZenNotes ${updateState.availableVersion ?? ''}…`,
307 {
308 progressPercent: 0,
309 transferredBytes: 0,
310 totalBytes: null,
311 bytesPerSecond: null
312 }
313 )
314 )
315
316 try {
317 await updater.downloadUpdate()
318 } catch (error) {
319 setUpdateState(
320 nextStateFromInfo('error', lastInfo, humanizeUpdateError(error))
321 )
322 }
323
324 return getAppUpdateState()
325}
326
327export function installAppUpdate(): void {
328 if (!updater || updateState.phase !== 'downloaded') return

Callers 2

registerIpcFunction · 0.90
runMenuUpdateCheckFunction · 0.90

Calls 4

setUpdateStateFunction · 0.85
nextStateFromInfoFunction · 0.85
humanizeUpdateErrorFunction · 0.85
getAppUpdateStateFunction · 0.70

Tested by

no test coverage detected