Add a loading toast when auto-updater download begins (#3995)

* Add a loading toast when update download begins

* Temporarily turn on artifact builds to test

* fmt

* Oops forgot to rename where I used a type

* Update src/index.tsx

* Update src/index.tsx

* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest)

* Add an `update-error` listener

* Flatten autoupdater hooks

* Revert "Temporarily turn on artifact builds to test"

This reverts commit e2e1991977.

* Switch branch to build-publish-apps on to this one

* Make the loading toast not attempt to display a version number

* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest)

* fmt

* Update .github/workflows/build-test-publish-apps.yml

Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>

* A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest)

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>
This commit is contained in:
Frank Noirot
2024-10-10 12:16:45 -04:00
committed by GitHub
parent accbc1fc3b
commit 7caa0aff7b
8 changed files with 53 additions and 2 deletions

View File

@ -261,10 +261,30 @@ app.on('ready', () => {
autoUpdater.checkForUpdates().catch(reportRejection)
}, fifteenMinutes)
autoUpdater.on('error', (error) => {
console.error('updater-error', error)
mainWindow?.webContents.send('updater-error', error)
})
autoUpdater.on('update-available', (info) => {
console.log('update-available', info)
})
autoUpdater.prependOnceListener('download-progress', (progress) => {
// For now, we'll send nothing and just start a loading spinner.
// See below for a TODO to send progress data to the renderer.
console.log('update-download-start', {
version: '',
})
mainWindow?.webContents.send('update-download-start', progress)
})
autoUpdater.on('download-progress', (progress) => {
// TODO: in a future PR (https://github.com/KittyCAD/modeling-app/issues/3994)
// send this data to mainWindow to show a progress bar for the download.
console.log('download-progress', progress)
})
autoUpdater.on('update-downloaded', (info) => {
console.log('update-downloaded', info)
mainWindow?.webContents.send('update-downloaded', info.version)