Files: 1d5204eb5cf8d3b7004c01b71b184796a5582121 / main.js
1190 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 | //we always need to have translations first! |
14 | {translations: require('./translations/sync')}, |
15 | require('./unread'), |
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 | }, |
29 | require('patchcore') |
30 | ) |
31 | |
32 | const api = entry(sockets, nest({ |
33 | 'app.html.app': 'first', |
34 | 'invite.async.autofollow': 'first', |
35 | 'config.sync.load': 'first' |
36 | })) |
37 | |
38 | document.body.appendChild(api.app.html.app()) |
39 | |
40 | var invite = api.config.sync.load().autoinvite |
41 | if(invite) |
42 | api.invite.async.autofollow( |
43 | invite, |
44 | function (err, follows) { |
45 | console.log('autofollowed', err, follows); |
46 | }) |
47 | else |
48 | console.log('no invite') |
49 |
Built with git-ssb-web