mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-12 20:18:41 -09:00
Retry loading it if config doesn't exist in auto updater (#2129)
* Made it easier * Return the config * Missing semicolon added * Fixed the linting
This commit is contained in:
parent
26abc6bd15
commit
a2d4936e50
3 changed files with 273 additions and 287 deletions
|
|
@ -1,6 +1,7 @@
|
|||
// Packages
|
||||
const {autoUpdater} = require('electron');
|
||||
const ms = require('ms');
|
||||
const retry = require('async-retry');
|
||||
|
||||
// Utilities
|
||||
const notify = require('./notify'); // eslint-disable-line no-unused-vars
|
||||
|
|
@ -16,7 +17,15 @@ function init() {
|
|||
console.error('Error fetching updates', msg + ' (' + err.stack + ')');
|
||||
});
|
||||
|
||||
const config = getConfig();
|
||||
const config = retry(() => {
|
||||
const content = getConfig();
|
||||
|
||||
if (!content) {
|
||||
throw new Error('No config content loaded');
|
||||
}
|
||||
|
||||
return content;
|
||||
});
|
||||
|
||||
// Default to the "stable" update channel
|
||||
let canaryUpdates = false;
|
||||
|
|
|
|||
|
|
@ -28,7 +28,8 @@
|
|||
"complexity": 0,
|
||||
"react/prop-types": 0,
|
||||
"react/jsx-no-bind": 0,
|
||||
"linebreak-style": 0
|
||||
"linebreak-style": 0,
|
||||
"import/no-extraneous-dependencies": 0
|
||||
},
|
||||
"ignores": [
|
||||
"build/**",
|
||||
|
|
@ -117,6 +118,7 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"aphrodite-simple": "0.4.1",
|
||||
"async-retry": "1.1.3",
|
||||
"color": "0.11.4",
|
||||
"hterm-umdjs": "1.1.3",
|
||||
"json-loader": "0.5.4",
|
||||
|
|
|
|||
Loading…
Reference in a new issue