mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-16 13:48:41 -09:00
Update shell after config change and notify the user (#405)
This commit is contained in:
parent
7a01ec77c4
commit
05eba4b521
1 changed files with 14 additions and 1 deletions
15
app/index.js
15
app/index.js
|
|
@ -6,6 +6,7 @@ const { resolve } = require('path');
|
||||||
const isDev = require('electron-is-dev');
|
const isDev = require('electron-is-dev');
|
||||||
const AutoUpdater = require('./auto-updater');
|
const AutoUpdater = require('./auto-updater');
|
||||||
const toHex = require('convert-css-color-name-to-hex');
|
const toHex = require('convert-css-color-name-to-hex');
|
||||||
|
const notify = require('./notify');
|
||||||
|
|
||||||
// set up config
|
// set up config
|
||||||
const config = require('./config');
|
const config = require('./config');
|
||||||
|
|
@ -41,7 +42,8 @@ app.on('window-all-closed', () => {
|
||||||
|
|
||||||
app.on('ready', () => {
|
app.on('ready', () => {
|
||||||
function createWindow (fn) {
|
function createWindow (fn) {
|
||||||
const cfg = plugins.getDecoratedConfig();
|
let cfg = plugins.getDecoratedConfig();
|
||||||
|
|
||||||
const [width, height] = cfg.windowSize || [540, 380];
|
const [width, height] = cfg.windowSize || [540, 380];
|
||||||
|
|
||||||
const browserDefaults = {
|
const browserDefaults = {
|
||||||
|
|
@ -70,7 +72,18 @@ app.on('ready', () => {
|
||||||
|
|
||||||
// config changes
|
// config changes
|
||||||
const cfgUnsubscribe = config.subscribe(() => {
|
const cfgUnsubscribe = config.subscribe(() => {
|
||||||
|
const cfg_ = plugins.getDecoratedConfig();
|
||||||
|
|
||||||
win.webContents.send('config change');
|
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', () => {
|
rpc.on('init', () => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue