Commit 9403dbfd2676f11563ac280b635c929cc14dafba
exclude local peers from who to follow, and hide active channels when none
Matt McKegg committed on 3/13/2017, 5:11:54 PMParent: bae71a076e7b535e5b20961c3a04284ce808a62f
Files changed
modules/page/html/render/public.js | changed |
modules/page/html/render/public.js | ||
---|---|---|
@@ -112,16 +112,16 @@ | ||
112 | 112 | |
113 | 113 | return result |
114 | 114 | |
115 | 115 | function getSidebar () { |
116 | - var whoToFollow = computed([following, api.profile.obs.recentlyUpdated(200)], (following, recent) => { | |
117 | - return Array.from(recent).filter(x => x !== id && !following.has(x)).slice(0, 10) | |
116 | + var whoToFollow = computed([following, api.profile.obs.recentlyUpdated(200), localPeers], (following, recent, peers) => { | |
117 | + return Array.from(recent).filter(x => x !== id && !following.has(x) && !peers.includes(x)).slice(0, 10) | |
118 | 118 | }) |
119 | 119 | return [ |
120 | 120 | h('button -pub -full', { |
121 | 121 | 'ev-click': api.invite.sheet |
122 | 122 | }, '+ Join Pub'), |
123 | - h('h2', 'Active Channels'), | |
123 | + when(computed(channels, x => x.length), h('h2', 'Active Channels')), | |
124 | 124 | when(loading, [ h('Loading') ]), |
125 | 125 | h('div', { |
126 | 126 | classList: 'ChannelList', |
127 | 127 | hidden: loading |
@@ -164,10 +164,9 @@ | ||
164 | 164 | h('div.name', [ '@', api.about.obs.name(id) ]) |
165 | 165 | ]) |
166 | 166 | ]) |
167 | 167 | }) |
168 | - ]), | |
169 | - h('div', {classList: 'Loading'}) | |
168 | + ]) | |
170 | 169 | ) |
171 | 170 | ] |
172 | 171 | } |
173 | 172 |
Built with git-ssb-web