diff --git a/freechat-client/main.js b/freechat-client/main.js index 594596f..1f0453d 100644 --- a/freechat-client/main.js +++ b/freechat-client/main.js @@ -1,15 +1,12 @@ -const { ArgumentParser } = require('argparse') +const { ipcMain } = require('electron') const { app, BrowserWindow } = require('electron') const path = require('path') -const cfg = require('./js/config.js') +const cfg = require('./src/config.js') let win const config = cfg.get_config(cfg.load_parser()) -console.log('Config: ', config) - - function createWin() { win = new BrowserWindow({ @@ -19,7 +16,7 @@ function createWin() { minHeight: 480, webPreferences: { nodeIntegration: true, - preload: path.join(__dirname + 'preload.js') + preload: path.join(__dirname + '/preload.js') }, autoHideMenuBar: true, }) @@ -51,3 +48,7 @@ app.on('activate', () => { } }); +// returns the config +ipcMain.on('config-request', (event, _arg) => { + event.returnValue = config +})