git ssb

2+

mixmix / ticktack



Tree: 6cc3ba8e958c74086d517dc9dfe1236bdde29e2d

Files: 6cc3ba8e958c74086d517dc9dfe1236bdde29e2d / app / obs / pluginsOk.js

595 bytesRaw
1const nest = require('depnest')
2const { h, onceTrue, Value } = require('mutant')
3
4exports.gives = nest('app.obs.pluginsOk')
5
6exports.needs = nest({
7 'sbot.obs.connection': 'first'
8})
9
10exports.create = (api) => {
11 var ok = Value()
12
13 return nest('app.obs.pluginsOk', function pluginsOk () {
14 if (ok() == undefined) checkForTrouble()
15
16 return ok
17 })
18
19 function checkForTrouble () {
20 onceTrue(
21 api.sbot.obs.connection,
22 sbot => {
23 if (!sbot.channel) ok.set(false) // TODO could build a list of missing plugins + effects
24 else ok.set(true)
25 }
26 )
27 }
28}
29
30

Built with git-ssb-web