update sbot to use() phoenix-api

This commit is contained in:
Paul Frazee 2015-07-01 13:02:59 -05:00
parent f988d7fbe8
commit 026de532c8
3 changed files with 10 additions and 5 deletions

View File

@ -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([{

View File

@ -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) {

View File

@ -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",