git ssb

16+

Dominic / patchbay



Commit a8df0b8c646db057a533878f17a685053a3d282f

Change the meaning of only people I follow to mean people and channels instead, to make channel subscription more effective and to decrease the filter bubble

Anders Rune Jensen committed on 3/22/2018, 8:18:53 PM
Parent: 574f6c0bba4fe737aa2d99154b42255b8e468848

Files changed

app/html/filter.jschanged
app/html/filter.jsView
@@ -12,8 +12,9 @@
1212 exports.needs = nest({
1313 'about.async.suggest': 'first',
1414 'channel.async.suggest': 'first',
1515 'contact.obs.following': 'first',
16 + 'channel.obs.subscribed': 'first',
1617 'keys.sync.id': 'first',
1718 'settings.obs.get': 'first',
1819 'settings.sync.set': 'first'
1920 })
@@ -27,8 +28,9 @@
2728 const showFilters = Value(false)
2829
2930 const myId = api.keys.sync.id()
3031 const peopleIFollow = api.contact.obs.following(myId)
32 + const channelsIFollow = api.channel.obs.subscribed(myId)
3133
3234 const filterSettings = api.settings.obs.get('filter', {exclude: {}})
3335
3436 const channelInput = h('input', {
@@ -70,9 +72,9 @@
7072 h('i.fa.fa-filter')
7173 ]),
7274 h('section', [
7375 h('div.users', [
74- toggle({ type: 'peopleIFollow', filterGroup: 'only', label: 'Only people I follow' }),
76 + toggle({ type: 'peopleAndChannelsIFollow', filterGroup: 'only', label: 'Only people & channels I follow' }),
7577 h('div.user-filter', [
7678 h('label', 'Only this user (temporary filter):'),
7779 userInput
7880 ])
@@ -151,11 +153,12 @@
151153 draw()
152154 })
153155
154156 function followFilter (msg) {
155- if (!filterSettings().only.peopleIFollow) return true
157 + if (!filterSettings().only.peopleAndChannelsIFollow) return true
156158
157- return Array.from(peopleIFollow()).concat(myId).includes(msg.value.author)
159 + return Array.from(peopleIFollow()).concat(myId).includes(msg.value.author) ||
160 + (msg.value.content && Array.from(channelsIFollow()).includes(msg.value.content.channel))
158161 }
159162
160163 function userFilter (msg) {
161164 if (!userId) return true

Built with git-ssb-web