Files: b206911bfe9aa61b8eb303bde755d1d378e4361e / main.js
1226 bytesRaw
1 | const combine = require('depject') |
2 | const entry = require('depject/entry') |
3 | const nest = require('depnest') |
4 | |
5 | // polyfills |
6 | require('setimmediate') |
7 | |
8 | // add inspect right click menu |
9 | require('./context-menu') |
10 | |
11 | // from more specialized to more general |
12 | const sockets = combine( |
13 | require('patch-settings'), |
14 | //we always need to have translations first! |
15 | { translations: require('./translations/sync') }, |
16 | { |
17 | about: require('./about'), |
18 | app: require('./app'), |
19 | blob: require('./blob'), |
20 | channel: require('./channel'), |
21 | //config: require('./ssb-config'), |
22 | config: require('./config'), |
23 | // group: require('./group'), |
24 | message: require('./message'), |
25 | router: require('./router'), |
26 | styles: require('./styles'), |
27 | state: require('./state/obs'), |
28 | unread: require('./unread'), |
29 | }, |
30 | require('patchcore') |
31 | ) |
32 | |
33 | const api = entry(sockets, nest({ |
34 | 'app.html.app': 'first', |
35 | 'invite.async.autofollow': 'first', |
36 | 'config.sync.load': 'first' |
37 | })) |
38 | |
39 | document.body.appendChild(api.app.html.app()) |
40 | |
41 | var invite = api.config.sync.load().autoinvite |
42 | if(invite) |
43 | api.invite.async.autofollow( |
44 | invite, |
45 | function (err, follows) { |
46 | console.log('autofollowed', err, follows); |
47 | }) |
48 | else |
49 | console.log('no invite') |
50 | |
51 |
Built with git-ssb-web