Browse Source

add 'fetch-config' message handler

Paul Frazee 5 years ago
parent
commit
b459569dcf
2 changed files with 7 additions and 0 deletions
  1. 1
    0
      app/index.js
  2. 6
    0
      app/lib/muxrpc-ipc.js

+ 1
- 0
app/index.js View File

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

+ 6
- 0
app/lib/muxrpc-ipc.js View File

@@ -31,4 +31,10 @@ module.exports = function (sbot, window) {
31 31
   pull(ipcPush, rpcStream, pull.drain(function (msg) {
32 32
     window.webContents.send('muxrpc-ssb', msg)
33 33
   }))
34
+
35
+  // setup helper messages
36
+  ipc.on('fetch-config', function(e) {
37
+    if (e.sender == window.webContents)
38
+      e.returnValue = sbot.config
39
+  });
34 40
 }

Loading…
Cancel
Save