Files: 0a4073c00a2da5c212e6f7ecf45ad96cc8818d14 / app / obs / pluginsOk.js
595 bytesRaw
1 | const nest = require('depnest') |
2 | const { h, onceTrue, Value } = require('mutant') |
3 | |
4 | exports.gives = nest('app.obs.pluginsOk') |
5 | |
6 | exports.needs = nest({ |
7 | 'sbot.obs.connection': 'first' |
8 | }) |
9 | |
10 | exports.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