Files: ffafa0a438ec210ba9585086400bf5b88d974c02 / main.js
1288 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 | //need some modules first |
14 | { |
15 | settings: require('patch-settings'), |
16 | translations: require('./translations/sync') |
17 | }, |
18 | { |
19 | about: require('./about'), |
20 | app: require('./app'), |
21 | blob: require('./blob'), |
22 | //config: require('./ssb-config'), |
23 | config: require('./config'), |
24 | // group: require('./group'), |
25 | message: require('./message'), |
26 | router: require('./router'), |
27 | styles: require('./styles'), |
28 | state: require('./state/obs'), |
29 | unread: require('./unread'), |
30 | }, |
31 | { |
32 | suggestions: require('patch-suggest'), |
33 | profile: require('patch-profile'), |
34 | core: require('patchcore') |
35 | } |
36 | ) |
37 | |
38 | const api = entry(sockets, nest({ |
39 | 'app.html.app': 'first', |
40 | 'invite.async.autofollow': 'first', |
41 | 'config.sync.load': 'first' |
42 | })) |
43 | |
44 | document.body.appendChild(api.app.html.app()) |
45 | |
46 | var invite = api.config.sync.load().autoinvite |
47 | if(invite) |
48 | api.invite.async.autofollow( |
49 | invite, |
50 | function (err, follows) { |
51 | console.log('autofollowed', err, follows); |
52 | }) |
53 | else |
54 | console.log('no invite') |
55 |
Built with git-ssb-web