git ssb

2+

mixmix / ticktack



Tree: ec7545f42881ca25d5d62a67b797b7ca4104ad11

Files: ec7545f42881ca25d5d62a67b797b7ca4104ad11 / app / obs / pluginsOk.js

834 bytesRaw
1const nest = require('depnest')
2const { 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 // TODO - differentiate and enable / disable based on channel || ticktack plugin missing
12 var ok = Value()
13
14 return nest('app.obs.pluginsOk', function pluginsOk () {
15 if (ok() === null) checkForTrouble()
16
17 return ok
18 })
19
20 function checkForTrouble () {
21 onceTrue(
22 api.sbot.obs.connection,
23 sbot => {
24 if (!sbot.channel) console.log('> channel plugin missing!')
25 if (!sbot.tickack) console.log('> ticktack plugin missing!')
26
27 if (!sbot.channel || !sbot.ticktack) ok.set(false) // TODO could build a list of missing plugins + effects
28 else ok.set(true)
29 }
30 )
31 }
32}
33

Built with git-ssb-web