Commit 46d4867aaf1d06eb2172236393ad7fc7f2ff354e
catch missing ticktack plugin
mix irving committed on 5/15/2018, 11:47:18 PMParent: 81bbaa6bd8489fef897a37bb689a642019279f22
Files changed
app/html/header.js | changed |
app/html/header.mcss | changed |
app/html/sideNav/sideNav.mcss | changed |
app/obs/pluginsOk.js | changed |
package-lock.json | changed |
app/html/header.js | ||
---|---|---|
@@ -3,8 +3,11 @@ | ||
3 | 3 … | const path = require('path') |
4 | 4 … | const { remote } = require('electron') |
5 | 5 … | |
6 | 6 … | exports.gives = nest('app.html.header') |
7 … | +exports.needs = nest({ | |
8 … | + 'app.obs.pluginsOk': 'first' | |
9 … | +}) | |
7 | 10 … | |
8 | 11 … | const SETTINGS_PAGES = [ |
9 | 12 … | 'settings', |
10 | 13 … | 'userEdit' |
@@ -40,11 +43,19 @@ | ||
40 | 43 … | h('img.settings', { |
41 | 44 … | src: when(isSettings, assetPath('settings_on.png'), assetPath('settings.png')), |
42 | 45 … | 'ev-click': () => push({page: 'settings'}) |
43 | 46 … | }), |
44 | - h('i.fa', { | |
45 | - className: when(isNotifications, 'fa-bell', 'fa-bell-o'), | |
46 | - 'ev-click': () => push({page: 'statsShow'}) | |
47 … | + computed(api.app.obs.pluginsOk(), ok => { | |
48 … | + return h('i.fa', { | |
49 … | + classList: [ | |
50 … | + when(isNotifications, 'fa-bell', 'fa-bell-o'), | |
51 … | + when(!ok, '-disabled') | |
52 … | + ], | |
53 … | + 'ev-click': () => { | |
54 … | + if (!ok) return | |
55 … | + push({page: 'statsShow'}) | |
56 … | + } | |
57 … | + }) | |
47 | 58 … | }) |
48 | 59 … | ]) |
49 | 60 … | ]) |
50 | 61 … | }) |
app/html/header.mcss | ||
---|---|---|
@@ -37,8 +37,12 @@ | ||
37 | 37 … | } |
38 | 38 … | |
39 | 39 … | i { font-size: 1.4rem } |
40 | 40 … | i.fa-bell-o { color: #7da9ea } |
41 … | + i.-disabled { | |
42 … | + filter: opacity(.4) | |
43 … | + cursor: not-allowed | |
44 … | + } | |
41 | 45 … | |
42 | 46 … | (a) { |
43 | 47 … | color: #222 |
44 | 48 … | margin-right: 1rem |
app/html/sideNav/sideNav.mcss | |||
---|---|---|---|
@@ -53,8 +53,9 @@ | |||
53 | 53 … | filter: saturate(0) | |
54 | 54 … | opacity: .5 | |
55 | 55 … | :hover { | |
56 | 56 … | cursor: not-allowed | |
57 … | + background: initial | ||
57 | 58 … | } | |
58 | 59 … | } | |
59 | 60 … | ||
60 | 61 … | div.spacer { |
app/obs/pluginsOk.js | ||
---|---|---|
@@ -1,29 +1,32 @@ | ||
1 | 1 … | const nest = require('depnest') |
2 | -const { h, onceTrue, Value } = require('mutant') | |
2 … | +const { onceTrue, Value } = require('mutant') | |
3 | 3 … | |
4 | 4 … | exports.gives = nest('app.obs.pluginsOk') |
5 | 5 … | |
6 | 6 … | exports.needs = nest({ |
7 | 7 … | 'sbot.obs.connection': 'first' |
8 | 8 … | }) |
9 | 9 … | |
10 | 10 … | exports.create = (api) => { |
11 … | + // TODO - differentiate and enable / disable based on channel || ticktack plugin missing | |
11 | 12 … | var ok = Value() |
12 | 13 … | |
13 | 14 … | return nest('app.obs.pluginsOk', function pluginsOk () { |
14 | - if (ok() == undefined) checkForTrouble() | |
15 … | + if (ok() === null) checkForTrouble() | |
15 | 16 … | |
16 | 17 … | return ok |
17 | 18 … | }) |
18 | 19 … | |
19 | 20 … | function checkForTrouble () { |
20 | 21 … | onceTrue( |
21 | 22 … | api.sbot.obs.connection, |
22 | 23 … | sbot => { |
23 | - if (!sbot.channel) ok.set(false) // TODO could build a list of missing plugins + effects | |
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 | |
24 | 28 … | else ok.set(true) |
25 | 29 … | } |
26 | 30 … | ) |
27 | 31 … | } |
28 | 32 … | } |
29 | - |
package-lock.json | ||
---|---|---|
The diff is too large to show. Use a local git client to view these changes. Old file size: 283856 bytes New file size: 283869 bytes |
Built with git-ssb-web