-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
56 lines (50 loc) · 1.33 KB
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
const combine = require('depject')
const entry = require('depject/entry')
const nest = require('depnest')
// polyfills
require('setimmediate')
// add inspect right click menu
require('./context-menu')
// from more specialized to more general
const sockets = combine(
//need some modules first
{
settings: require('patch-settings'),
translations: require('./translations/sync')
},
{
about: require('./about'),
app: require('./app'),
blob: require('./blob'),
contact: require('./contact'),
//config: require('./ssb-config'),
config: require('./config'),
// group: require('./group'),
message: require('./message'),
router: require('./router'),
styles: require('./styles'),
state: require('./state/obs'),
unread: require('./unread'),
},
{
suggestions: require('patch-suggest'),
profile: require('patch-profile'),
history: require('patch-history'),
core: require('patchcore')
}
)
const api = entry(sockets, nest({
'app.html.app': 'first',
'invite.async.autofollow': 'first',
'config.sync.load': 'first'
}))
document.body.appendChild(api.app.html.app())
var invite = api.config.sync.load().autoinvite
if(invite)
api.invite.async.autofollow(
invite,
function (err, follows) {
console.log('autofollowed', err, follows);
})
else
console.log('no invite')