git ssb

2+

mixmix / ticktack



Commit 798294563ae751e766eb3b48905f401fc64fa61e

fix mutant problem with a channels page

mix irving committed on 2/5/2018, 8:17:11 PM
Parent: e0d107ad69994e3ff7d0afbd9e1e9e5c94f195f8

Files changed

app/page/channelSubscriptions.jschanged
app/page/channelSubscriptions.jsView
@@ -1,6 +1,6 @@
11 const nest = require('depnest')
2-const { h, when, Value, onceTrue } = require('mutant')
2+const { h, when, Value, onceTrue, computed, map: mutantMap } = require('mutant')
33 const sortBy = require('lodash/sortBy')
44 const map = require("lodash/map")
55
66
@@ -30,15 +30,19 @@
3030 let myChannels, displaySubscriptions
3131
3232 if (location.scope === "user") {
3333 myChannels = subscribed(myId)
34- displaySubscriptions = () => [...myChannels().values()].map(c => api.app.html.channelCard(c))
34+
35+ const mySubscriptions = computed(myChannels, myChannels => [...myChannels.values()])
3536
3637 return h('Page -channelSubscriptions', { title: strings.home }, [
3738 api.app.html.sideNav(location),
3839 h('div.content', [
3940 //api.app.html.topNav(location),
40- when(myChannels, displaySubscriptions, h("p", "Loading..."))
41+ when(myChannels,
42+ mutantMap(mySubscriptions, api.app.html.channelCard),
43+ h("p", "Loading...")
44+ )
4145 ])
4246 ])
4347
4448 }

Built with git-ssb-web