From b459569dcf31e0174dbc544969b3dc5de001527f Mon Sep 17 00:00:00 2001 From: Paul Frazee Date: Thu, 25 Jun 2015 18:53:06 -0500 Subject: [PATCH] add 'fetch-config' message handler --- app/index.js | 1 + app/lib/muxrpc-ipc.js | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/app/index.js b/app/index.js index 5911830..9886b73 100644 --- a/app/index.js +++ b/app/index.js @@ -25,6 +25,7 @@ app.on('ready', function ready () { // open the web app mainWindow = new BrowserWindow({width: 1000, height: 720}) + // mainWindow.openDevTools() mainWindow.loadUrl('file://' + path.join(__dirname, '../node_modules/ssbplug-phoenix/home.html')) mainWindow.webContents.on('new-window', onNewWindow) mainWindow.on('closed', function() { mainWindow = null }) diff --git a/app/lib/muxrpc-ipc.js b/app/lib/muxrpc-ipc.js index 4d24f48..77f9984 100644 --- a/app/lib/muxrpc-ipc.js +++ b/app/lib/muxrpc-ipc.js @@ -31,4 +31,10 @@ module.exports = function (sbot, window) { pull(ipcPush, rpcStream, pull.drain(function (msg) { window.webContents.send('muxrpc-ssb', msg) })) + + // setup helper messages + ipc.on('fetch-config', function(e) { + if (e.sender == window.webContents) + e.returnValue = sbot.config + }); } \ No newline at end of file