diff options
author | kytwb <kytwb@pm.me> | 2021-12-24 13:20:09 +0100 |
---|---|---|
committer | kytwb <kytwb@pm.me> | 2021-12-24 13:20:09 +0100 |
commit | 2d989fccc22d31bed58300277cbe47be0a7875e2 (patch) | |
tree | 8f1186c4a6b43b90545192fb345325b8b3dc91ef /src | |
parent | #2359 Disable available updates behaviour based on automaticUpdates (diff) | |
download | ferdium-app-2d989fccc22d31bed58300277cbe47be0a7875e2.tar.gz ferdium-app-2d989fccc22d31bed58300277cbe47be0a7875e2.tar.zst ferdium-app-2d989fccc22d31bed58300277cbe47be0a7875e2.zip |
Prevent error swallowing on autoUpdate event
Diffstat (limited to 'src')
-rw-r--r-- | src/stores/AppStore.js | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/src/stores/AppStore.js b/src/stores/AppStore.js index 2698749fc..cdb8586ca 100644 --- a/src/stores/AppStore.js +++ b/src/stores/AppStore.js | |||
@@ -162,27 +162,29 @@ export default class AppStore extends Store { | |||
162 | // Check for an update in 30s (need a delay to prevent Squirrel Installer lock file issues) | 162 | // Check for an update in 30s (need a delay to prevent Squirrel Installer lock file issues) |
163 | setTimeout(() => this._checkForUpdates(), ms('30s')); | 163 | setTimeout(() => this._checkForUpdates(), ms('30s')); |
164 | ipcRenderer.on('autoUpdate', (event, data) => { | 164 | ipcRenderer.on('autoUpdate', (event, data) => { |
165 | if (data.available) { | 165 | if (this.updateStatus !== this.updateStatusTypes.FAILED) { |
166 | this.updateStatus = this.updateStatusTypes.AVAILABLE; | 166 | if (data.available) { |
167 | if (isMac && this.stores.settings.app.automaticUpdates) { | 167 | this.updateStatus = this.updateStatusTypes.AVAILABLE; |
168 | app.dock.bounce(); | 168 | if (isMac && this.stores.settings.app.automaticUpdates) { |
169 | app.dock.bounce(); | ||
170 | } | ||
169 | } | 171 | } |
170 | } | ||
171 | 172 | ||
172 | if (data.available !== undefined && !data.available) { | 173 | if (data.available !== undefined && !data.available) { |
173 | this.updateStatus = this.updateStatusTypes.NOT_AVAILABLE; | 174 | this.updateStatus = this.updateStatusTypes.NOT_AVAILABLE; |
174 | } | 175 | } |
175 | 176 | ||
176 | if (data.downloaded) { | 177 | if (data.downloaded) { |
177 | this.updateStatus = this.updateStatusTypes.DOWNLOADED; | 178 | this.updateStatus = this.updateStatusTypes.DOWNLOADED; |
178 | if (isMac && this.stores.settings.app.automaticUpdates) { | 179 | if (isMac && this.stores.settings.app.automaticUpdates) { |
179 | app.dock.bounce(); | 180 | app.dock.bounce(); |
181 | } | ||
180 | } | 182 | } |
181 | } | ||
182 | 183 | ||
183 | if (data.error) { | 184 | if (data.error) { |
184 | console.log('Updater error:', data.error); | 185 | console.log('Updater error:', data.error); |
185 | this.updateStatus = this.updateStatusTypes.FAILED; | 186 | this.updateStatus = this.updateStatusTypes.FAILED; |
187 | } | ||
186 | } | 188 | } |
187 | }); | 189 | }); |
188 | 190 | ||