git ssb

0+

alanz / patchwork



forked from Matt McKegg / patchwork

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 PM
Parent: bae71a076e7b535e5b20961c3a04284ce808a62f

Files changed

modules/page/html/render/public.jschanged
modules/page/html/render/public.jsView
@@ -112,16 +112,16 @@
112112
113113 return result
114114
115115 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)
118118 })
119119 return [
120120 h('button -pub -full', {
121121 'ev-click': api.invite.sheet
122122 }, '+ Join Pub'),
123- h('h2', 'Active Channels'),
123+ when(computed(channels, x => x.length), h('h2', 'Active Channels')),
124124 when(loading, [ h('Loading') ]),
125125 h('div', {
126126 classList: 'ChannelList',
127127 hidden: loading
@@ -164,10 +164,9 @@
164164 h('div.name', [ '@', api.about.obs.name(id) ])
165165 ])
166166 ])
167167 })
168- ]),
169- h('div', {classList: 'Loading'})
168+ ])
170169 )
171170 ]
172171 }
173172

Built with git-ssb-web