git ssb

2+

mixmix / ticktack



Commit 46d4867aaf1d06eb2172236393ad7fc7f2ff354e

catch missing ticktack plugin

mix irving committed on 5/15/2018, 11:47:18 PM
Parent: 81bbaa6bd8489fef897a37bb689a642019279f22

Files changed

app/html/header.jschanged
app/html/header.mcsschanged
app/html/sideNav/sideNav.mcsschanged
app/obs/pluginsOk.jschanged
package-lock.jsonchanged
app/html/header.jsView
@@ -3,8 +3,11 @@
33 const path = require('path')
44 const { remote } = require('electron')
55
66 exports.gives = nest('app.html.header')
7 +exports.needs = nest({
8 + 'app.obs.pluginsOk': 'first'
9 +})
710
811 const SETTINGS_PAGES = [
912 'settings',
1013 'userEdit'
@@ -40,11 +43,19 @@
4043 h('img.settings', {
4144 src: when(isSettings, assetPath('settings_on.png'), assetPath('settings.png')),
4245 'ev-click': () => push({page: 'settings'})
4346 }),
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 + })
4758 })
4859 ])
4960 ])
5061 })
app/html/header.mcssView
@@ -37,8 +37,12 @@
3737 }
3838
3939 i { font-size: 1.4rem }
4040 i.fa-bell-o { color: #7da9ea }
41 + i.-disabled {
42 + filter: opacity(.4)
43 + cursor: not-allowed
44 + }
4145
4246 (a) {
4347 color: #222
4448 margin-right: 1rem
app/html/sideNav/sideNav.mcssView
@@ -53,8 +53,9 @@
5353 filter: saturate(0)
5454 opacity: .5
5555 :hover {
5656 cursor: not-allowed
57 + background: initial
5758 }
5859 }
5960
6061 div.spacer {
app/obs/pluginsOk.jsView
@@ -1,29 +1,32 @@
11 const nest = require('depnest')
2-const { h, onceTrue, Value } = require('mutant')
2 +const { onceTrue, Value } = require('mutant')
33
44 exports.gives = nest('app.obs.pluginsOk')
55
66 exports.needs = nest({
77 'sbot.obs.connection': 'first'
88 })
99
1010 exports.create = (api) => {
11 + // TODO - differentiate and enable / disable based on channel || ticktack plugin missing
1112 var ok = Value()
1213
1314 return nest('app.obs.pluginsOk', function pluginsOk () {
14- if (ok() == undefined) checkForTrouble()
15 + if (ok() === null) checkForTrouble()
1516
1617 return ok
1718 })
1819
1920 function checkForTrouble () {
2021 onceTrue(
2122 api.sbot.obs.connection,
2223 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
2428 else ok.set(true)
2529 }
2630 )
2731 }
2832 }
29-
package-lock.jsonView
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