git ssb

2+

mixmix / ticktack



Commit eba890bb7df89e06d7b260c4ad65b42369b4c27e

issue #70: bug related to observable fixed.

andre alves garzia committed on 2/6/2018, 1:53:08 AM
Parent: bfc0ca818ad29350778f773418c29b2622aca346

Files changed

app/page/channelShow.jschanged
app/page/channelSubscriptions.jschanged
app/page/channelShow.jsView
@@ -31,18 +31,9 @@
3131 const { subscribe, unsubscribe } = api.channel.async
3232 const { isSubscribedTo } = api.channel.obs
3333 const youSubscribe = isSubscribedTo(location.channel, myId)
3434
35- let cb = () => {
36- youSubscribe.set(isSubscribedTo(location.channel, myId))
37- }
38-
3935 var searchVal = resolve(location.channel)
40- var searchResults = computed([api.channel.obs.recent(), searchVal], (channels, val) => {
41- if (val.length < 2) return []
42-
43- return channels.filter(c => c.toLowerCase().indexOf(val.toLowerCase()) > -1)
44- })
4536
4637
4738
4839 createStream = api.feed.pull.channel(location.channel)
@@ -53,10 +44,10 @@
5344 h('section.about', [
5445 h('h1', location.channel),
5546 h('div.actions', [
5647 when(youSubscribe,
57- h('Button', { 'ev-click': () => subscribe(location.channel, cb) }, strings.channelShow.action.unsubscribe),
58- h('Button', { 'ev-click': () => unsubscribe(location.channel, cb) }, strings.channelShow.action.subscribe)
48+ h('Button', { 'ev-click': () => subscribe(location.channel) }, strings.channelShow.action.unsubscribe),
49+ h('Button', { 'ev-click': () => unsubscribe(location.channel) }, strings.channelShow.action.subscribe)
5950 )
6051 ])
6152 ]),
6253 ]
app/page/channelSubscriptions.jsView
@@ -39,9 +39,9 @@
3939 h('div.content', [
4040 //api.app.html.topNav(location),
4141 when(myChannels,
4242 mutantMap(mySubscriptions, api.app.html.channelCard),
43- h("p", "Loading...")
43+ h("p", strings.loading)
4444 )
4545 ])
4646 ])
4747
@@ -57,25 +57,23 @@
5757 sbot.channel.get((err, c) => {
5858 if (err) throw err
5959 let b = map(c, (v,k) => {return {channel: k, users: v}})
6060 b = sortBy(b, o => o.users.length)
61- myChannels.set(b.reverse().slice(0,100))
61+ let res = b.reverse().slice(0,100)
62+
63+ myChannels.set(res.map(c => c.channel))
6264 })
6365 }
6466 )
6567
6668
67- displaySubscriptions = () => {
68- if (myChannels()) {
69- let subs = myChannels()
70- return subs.map(c => api.app.html.channelCard(c.channel))
71- }
72- }
73-
74- return h('Page -channelSubscriptions', { title: strings.home }, [
69+ return h('Page -channelSubscriptions', { title: strings.home }, [
7570 api.app.html.sideNav(location),
7671 h('div.content', [
77- when(myChannels, displaySubscriptions, h("p", strings.loading))
72+ when(myChannels,
73+ mutantMap(myChannels, api.app.html.channelCard),
74+ h("p", strings.loading)
75+ )
7876 ])
7977 ])
8078 }
8179 })

Built with git-ssb-web