From f68984e20f23ec6bebaa6ef9fd1e738c79571d81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Mrzyg=C5=82=C3=B3d?= Date: Mon, 7 Aug 2017 15:18:22 +0200 Subject: [PATCH] Fixed not disappearing modal when an update is not available --- app/actions/layout.js | 6 ++++++ app/index.js | 4 ++++ app/updater.js | 1 + 3 files changed, 11 insertions(+) diff --git a/app/actions/layout.js b/app/actions/layout.js index 94c79f3..c6c823e 100644 --- a/app/actions/layout.js +++ b/app/actions/layout.js @@ -55,3 +55,9 @@ export function notifyProgress(progress: ProgressInfo) { type: PROGRESS, progress }; } + +export function clearErrors() { + return { + type: CLEAR_ERRORS + }; +} diff --git a/app/index.js b/app/index.js index b3b1100..5a2ea43 100644 --- a/app/index.js +++ b/app/index.js @@ -77,6 +77,10 @@ ipcRenderer.on('update-available', () => { store.dispatch(layoutActions.alert('An update is being downloaded, please wait...', [])); }); +ipcRenderer.on('update-not-available', () => { + store.dispatch(layoutActions.clearErrors()); +}); + ipcRenderer.on('update-progress', (event, progress) => { store.dispatch(layoutActions.notifyProgress(progress)); }); diff --git a/app/updater.js b/app/updater.js index e9f4f23..cc760e8 100644 --- a/app/updater.js +++ b/app/updater.js @@ -14,6 +14,7 @@ export default class Updater { autoUpdater.on('error', err => mainWindow.webContents.send('update-error', err.toString())); autoUpdater.on('checking-for-update', () => mainWindow.webContents.send('checking-for-update')); autoUpdater.on('update-available', () => mainWindow.webContents.send('update-available')); + autoUpdater.on('update-not-available', () => mainWindow.webContents.send('update-not-available')); autoUpdater.on('update-downloaded', () => autoUpdater.quitAndInstall()); autoUpdater.on('download-progress', (progress: ProgressInfo) => mainWindow.webContents.send('update-progress', progress));