Update shell after config change and notify the user (#405)

This commit is contained in:
Mike 2016-07-26 17:37:42 -06:00 committed by Guillermo Rauch
parent 7a01ec77c4
commit 05eba4b521

View file

@ -6,6 +6,7 @@ const { resolve } = require('path');
const isDev = require('electron-is-dev');
const AutoUpdater = require('./auto-updater');
const toHex = require('convert-css-color-name-to-hex');
const notify = require('./notify');
// set up config
const config = require('./config');
@ -41,7 +42,8 @@ app.on('window-all-closed', () => {
app.on('ready', () => {
function createWindow (fn) {
const cfg = plugins.getDecoratedConfig();
let cfg = plugins.getDecoratedConfig();
const [width, height] = cfg.windowSize || [540, 380];
const browserDefaults = {
@ -70,7 +72,18 @@ app.on('ready', () => {
// config changes
const cfgUnsubscribe = config.subscribe(() => {
const cfg_ = plugins.getDecoratedConfig();
win.webContents.send('config change');
if (cfg_.shell !== cfg.shell) {
notify(
'Shell configuration changed!',
'Open a new tab or window to start using the new shell'
);
}
cfg = cfg_;
});
rpc.on('init', () => {