Files: e22f86c7bff5c868d467f4c68c8873d068278f1f / main.js
1098 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 | { |
16 | about: require('./about'), |
17 | app: require('./app'), |
18 | blob: require('./blob'), |
19 | //config: require('./ssb-config'), |
20 | config: require('./config'), |
21 | message: require('./message'), |
22 | router: require('./router'), |
23 | styles: require('./styles'), |
24 | state: require('./state/obs'), |
25 | }, |
26 | require('patchcore') |
27 | ) |
28 | |
29 | const api = entry(sockets, nest({ |
30 | 'app.html.app': 'first', |
31 | 'invite.async.autofollow': 'first', |
32 | 'config.sync.load': 'first' |
33 | })) |
34 | |
35 | document.body.appendChild(api.app.html.app()) |
36 | |
37 | var invite = api.config.sync.load().autoinvite |
38 | if(invite) |
39 | api.invite.async.autofollow( |
40 | invite, |
41 | function (err, follows) { |
42 | console.log('autofollowed', err, follows); |
43 | }) |
44 | else |
45 | console.log('no invite') |
46 |
Built with git-ssb-web