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