add 'fetch-config' message handler

This commit is contained in:
Paul Frazee 2015-06-25 18:53:06 -05:00
parent 7f5bb1ffb2
commit b459569dcf
2 changed files with 7 additions and 0 deletions

View File

@ -25,6 +25,7 @@ app.on('ready', function ready () {
// open the web app // open the web app
mainWindow = new BrowserWindow({width: 1000, height: 720}) mainWindow = new BrowserWindow({width: 1000, height: 720})
// mainWindow.openDevTools()
mainWindow.loadUrl('file://' + path.join(__dirname, '../node_modules/ssbplug-phoenix/home.html')) mainWindow.loadUrl('file://' + path.join(__dirname, '../node_modules/ssbplug-phoenix/home.html'))
mainWindow.webContents.on('new-window', onNewWindow) mainWindow.webContents.on('new-window', onNewWindow)
mainWindow.on('closed', function() { mainWindow = null }) mainWindow.on('closed', function() { mainWindow = null })

View File

@ -31,4 +31,10 @@ module.exports = function (sbot, window) {
pull(ipcPush, rpcStream, pull.drain(function (msg) { pull(ipcPush, rpcStream, pull.drain(function (msg) {
window.webContents.send('muxrpc-ssb', 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
});
} }