Commit 8de1edb8454d207982be32e1b3b5a6e3497f19ce
don't include blocked people in "Who to follow"
Matt McKegg committed on 11/14/2017, 10:07:23 PMParent: 72efc85421d9d1773e46a9b1109d05b192a8e76f
Files changed
modules/page/html/render/public.js | changed |
modules/page/html/render/public.js | ||
---|---|---|
@@ -23,8 +23,9 @@ | ||
23 | 23 | |
24 | 24 | 'feed.html.rollup': 'first', |
25 | 25 | 'profile.obs.recentlyUpdated': 'first', |
26 | 26 | 'contact.obs.following': 'first', |
27 | + 'contact.obs.blocking': 'first', | |
27 | 28 | 'channel.obs': { |
28 | 29 | subscribed: 'first', |
29 | 30 | recent: 'first' |
30 | 31 | }, |
@@ -45,8 +46,9 @@ | ||
45 | 46 | if (path !== '/public') return // "/" is a sigil for "page" |
46 | 47 | |
47 | 48 | var id = api.keys.sync.id() |
48 | 49 | var following = api.contact.obs.following(id) |
50 | + var blocking = api.contact.obs.blocking(id) | |
49 | 51 | var subscribedChannels = api.channel.obs.subscribed(id) |
50 | 52 | var recentChannels = api.channel.obs.recent() |
51 | 53 | var loading = computed([subscribedChannels.sync, recentChannels.sync], (...args) => !args.every(Boolean)) |
52 | 54 | var channels = computed(recentChannels, items => items.slice(0, 8), {comparer: arrayEq}) |
@@ -137,10 +139,10 @@ | ||
137 | 139 | } |
138 | 140 | } |
139 | 141 | |
140 | 142 | function getSidebar () { |
141 | - var whoToFollow = computed([following, api.profile.obs.recentlyUpdated(), localPeers], (following, recent, peers) => { | |
142 | - return recent.filter(x => x !== id && !following.includes(x) && !peers.includes(x)).slice(0, 10) | |
143 | + var whoToFollow = computed([api.profile.obs.recentlyUpdated(), following, blocking, localPeers], (recent, ...ignoreFeeds) => { | |
144 | + return recent.filter(x => x !== id && !ignoreFeeds.some(f => f.includes(x))).slice(0, 10) | |
143 | 145 | }) |
144 | 146 | return [ |
145 | 147 | h('button -pub -full', { |
146 | 148 | 'ev-click': api.invite.sheet |
Built with git-ssb-web