Commit 798294563ae751e766eb3b48905f401fc64fa61e
fix mutant problem with a channels page
mix irving committed on 2/5/2018, 8:17:11 PMParent: e0d107ad69994e3ff7d0afbd9e1e9e5c94f195f8
Files changed
app/page/channelSubscriptions.js | changed |
app/page/channelSubscriptions.js | ||
---|---|---|
@@ -1,6 +1,6 @@ | ||
1 | 1 | const nest = require('depnest') |
2 | -const { h, when, Value, onceTrue } = require('mutant') | |
2 | +const { h, when, Value, onceTrue, computed, map: mutantMap } = require('mutant') | |
3 | 3 | const sortBy = require('lodash/sortBy') |
4 | 4 | const map = require("lodash/map") |
5 | 5 | |
6 | 6 | |
@@ -30,15 +30,19 @@ | ||
30 | 30 | let myChannels, displaySubscriptions |
31 | 31 | |
32 | 32 | if (location.scope === "user") { |
33 | 33 | myChannels = subscribed(myId) |
34 | - displaySubscriptions = () => [...myChannels().values()].map(c => api.app.html.channelCard(c)) | |
34 | + | |
35 | + const mySubscriptions = computed(myChannels, myChannels => [...myChannels.values()]) | |
35 | 36 | |
36 | 37 | return h('Page -channelSubscriptions', { title: strings.home }, [ |
37 | 38 | api.app.html.sideNav(location), |
38 | 39 | h('div.content', [ |
39 | 40 | //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 | + ) | |
41 | 45 | ]) |
42 | 46 | ]) |
43 | 47 | |
44 | 48 | } |
Built with git-ssb-web