Review fixes

pull/967/head
Mikunj 5 years ago
parent 86b427cc4d
commit d31feed2c0

@ -1091,18 +1091,20 @@ ipc.on('set-media-permissions', (event, value) => {
}); });
// Loki - Auto updating // Loki - Auto updating
ipc.on('get-auto-update-enabled', event => { ipc.on('get-auto-update-setting', event => {
const configValue = userConfig.get('autoUpdate'); const configValue = userConfig.get('autoUpdate');
// eslint-disable-next-line no-param-reassign // eslint-disable-next-line no-param-reassign
event.returnValue = typeof configValue !== 'boolean' ? true : configValue; event.returnValue = typeof configValue !== 'boolean' ? true : configValue;
}); });
ipc.on('set-auto-update-enabled', (event, value) => { ipc.on('set-auto-update-setting', (event, enabled) => {
userConfig.set('autoUpdate', !!value); userConfig.set('autoUpdate', !!enabled);
// Stop updater if user turned it off if (enabled) {
if (!value) { readyForUpdates();
} else {
updater.stop(); updater.stop();
isReadyForUpdates = false;
} }
}); });

@ -241,9 +241,9 @@ window.getMessageTTL = () => window.storage.get('message-ttl', 24);
window.getMediaPermissions = () => ipc.sendSync('get-media-permissions'); window.getMediaPermissions = () => ipc.sendSync('get-media-permissions');
// Auto update setting // Auto update setting
window.getAutoUpdateEnabled = () => ipc.sendSync('get-auto-update-enabled'); window.getAutoUpdateEnabled = () => ipc.sendSync('get-auto-update-setting');
window.setAutoUpdateEnabled = value => window.setAutoUpdateEnabled = value =>
ipc.send('set-auto-update-enabled', !!value); ipc.send('set-auto-update-setting', !!value);
ipc.on('get-ready-for-shutdown', async () => { ipc.on('get-ready-for-shutdown', async () => {
const { shutdown } = window.Events || {}; const { shutdown } = window.Events || {};

Loading…
Cancel
Save