diff --git a/app/index.js b/app/index.js index a82ef8c..2a49813 100644 --- a/app/index.js +++ b/app/index.js @@ -16,7 +16,10 @@ app.on('ready', function ready () { // start sbot require('scuttlebot').init(config, function (err, sbot) { - // register protocols + // register sbot plugins + sbot.use(require('phoenix-api')) + + // register electron protocols require('protocol').registerProtocol('blob', blobs.protocol) // open the web app @@ -26,7 +29,7 @@ app.on('ready', function ready () { blobs, { width: 1000, height: 720 } ) - mainWindow.openDevTools() + // mainWindow.openDevTools() // setup menu // Menu.setApplicationMenu(Menu.buildFromTemplate([{ diff --git a/app/lib/muxrpc-ipc.js b/app/lib/muxrpc-ipc.js index c83ac23..682a025 100644 --- a/app/lib/muxrpc-ipc.js +++ b/app/lib/muxrpc-ipc.js @@ -25,9 +25,10 @@ module.exports = function (window, sbot, params) { if (e.sender == window.webContents) ipcPush.push(msg) }) - pull(ipcPush, rpcStream, pull.drain(function (msg) { - window.webContents.send('muxrpc-ssb', msg) - })) + pull(ipcPush, rpcStream, pull.drain( + function (msg) { window.webContents.send('muxrpc-ssb', msg) }, + function (err) { if (err) { console.error(err) } } + )) // setup helper messages ipc.on('fetch-config', function(e) { diff --git a/package.json b/package.json index 07e167d..ec65b78 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ "multiblob": "^1.4.3", "multicb": "^1.1.0", "muxrpc": "^5.0.1", + "phoenix-api": "~8.0.0", "pull-pushable": "^1.1.4", "pull-stream": "^2.27.0", "scuttlebot": "^4.2.3",