mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-16 05:38:41 -09:00
index: initialize config and plugins together
This commit is contained in:
parent
622f584d15
commit
29b853fcbf
1 changed files with 4 additions and 4 deletions
8
index.js
8
index.js
|
|
@ -6,7 +6,11 @@ const genUid = require('uid2');
|
||||||
const { resolve } = require('path');
|
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');
|
||||||
|
|
||||||
|
// set up config
|
||||||
const config = require('./config');
|
const config = require('./config');
|
||||||
|
config.init();
|
||||||
|
const plugins = require('./plugins');
|
||||||
|
|
||||||
if (isDev) {
|
if (isDev) {
|
||||||
console.log('running in dev mode');
|
console.log('running in dev mode');
|
||||||
|
|
@ -24,9 +28,6 @@ const url = 'file://' + resolve(
|
||||||
|
|
||||||
console.log('electron will open', url);
|
console.log('electron will open', url);
|
||||||
|
|
||||||
// initializate configuration
|
|
||||||
config.init();
|
|
||||||
|
|
||||||
app.on('window-all-closed', () => {
|
app.on('window-all-closed', () => {
|
||||||
// by subscribing to this event and nooping
|
// by subscribing to this event and nooping
|
||||||
// we prevent electron's default behavior
|
// we prevent electron's default behavior
|
||||||
|
|
@ -54,7 +55,6 @@ app.on('ready', () => {
|
||||||
|
|
||||||
const rpc = createRPC(win);
|
const rpc = createRPC(win);
|
||||||
const sessions = new Map();
|
const sessions = new Map();
|
||||||
|
|
||||||
const cfgUnsubscribe = config.subscribe(() => {
|
const cfgUnsubscribe = config.subscribe(() => {
|
||||||
win.webContents.send('config change');
|
win.webContents.send('config change');
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue