Skip to content

Commit

Permalink
Adding more options for update check frequency, and setting default u…
Browse files Browse the repository at this point in the history
…pdate check frequency to one week
  • Loading branch information
thorpj committed Dec 7, 2018
1 parent 99a0b92 commit 1e9f54f
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 4 deletions.
2 changes: 1 addition & 1 deletion config.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ settings.setAll({
vibrantDark: settings.get('mode.vibrantDark', false)
},
sideBarHidden: settings.get('sideBarHidden', false),
updateCheckPeriod: settings.get('updateCheckPeriod', '2h'),
updateCheckPeriod: settings.get('updateCheckPeriod', '1w'),
useGlobalShortcuts: settings.get('useGlobalShortcuts', false),
zoomFactor: settings.get('zoomFactor', 1)
});
Expand Down
8 changes: 5 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,11 @@ app.on('ready', () => {
update.init(Menu.getApplicationMenu());

if (!isDevMode) {
setInterval(() => {
update.autoUpdateCheck();
}, ms(config.get('updateCheckPeriod')));
if (config.get('updateCheckPeriod') !== 'never') {
setInterval(() => {
update.autoUpdateCheck();
}, ms(config.get('updateCheckPeriod')));
}
}
});

Expand Down
40 changes: 40 additions & 0 deletions menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,46 @@ const helpSubmenu = [{
config.set('updateCheckPeriod', '24h');
requestAppRestart();
}
}, {
label: 'Once Every 3 Days',
type: 'checkbox',
checked: (config.get('updateCheckPeriod') === '3d'),
click() {
config.set('updateCheckPeriod', '3d');
requestAppRestart();
}
}, {
label: 'Once a Week',
type: 'checkbox',
checked: (config.get('updateCheckPeriod') === '1w'),
click() {
config.set('updateCheckPeriod', '1w');
requestAppRestart();
}
}, {
label: 'Once Every 2 Weeks',
type: 'checkbox',
checked: (config.get('updateCheckPeriod') === '2w'),
click() {
config.set('updateCheckPeriod', '2w');
requestAppRestart();
}
}, {
label: 'Once a Month',
type: 'checkbox',
checked: (config.get('updateCheckPeriod') === '4w'),
click() {
config.set('updateCheckPeriod', '4w');
requestAppRestart();
}
}, {
label: 'Never',
type: 'checkbox',
checked: (config.get('updateCheckPeriod') === 'never'),
click() {
config.set('updateCheckPeriod', 'never');
requestAppRestart();
}
}]
}, {
type: 'separator'
Expand Down

0 comments on commit 1e9f54f

Please sign in to comment.