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 PMParent: 574f6c0bba4fe737aa2d99154b42255b8e468848
Files changed
app/html/filter.js | changed |
app/html/filter.js | ||
---|---|---|
@@ -12,8 +12,9 @@ | ||
12 | 12 … | exports.needs = nest({ |
13 | 13 … | 'about.async.suggest': 'first', |
14 | 14 … | 'channel.async.suggest': 'first', |
15 | 15 … | 'contact.obs.following': 'first', |
16 … | + 'channel.obs.subscribed': 'first', | |
16 | 17 … | 'keys.sync.id': 'first', |
17 | 18 … | 'settings.obs.get': 'first', |
18 | 19 … | 'settings.sync.set': 'first' |
19 | 20 … | }) |
@@ -27,8 +28,9 @@ | ||
27 | 28 … | const showFilters = Value(false) |
28 | 29 … | |
29 | 30 … | const myId = api.keys.sync.id() |
30 | 31 … | const peopleIFollow = api.contact.obs.following(myId) |
32 … | + const channelsIFollow = api.channel.obs.subscribed(myId) | |
31 | 33 … | |
32 | 34 … | const filterSettings = api.settings.obs.get('filter', {exclude: {}}) |
33 | 35 … | |
34 | 36 … | const channelInput = h('input', { |
@@ -70,9 +72,9 @@ | ||
70 | 72 … | h('i.fa.fa-filter') |
71 | 73 … | ]), |
72 | 74 … | h('section', [ |
73 | 75 … | 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' }), | |
75 | 77 … | h('div.user-filter', [ |
76 | 78 … | h('label', 'Only this user (temporary filter):'), |
77 | 79 … | userInput |
78 | 80 … | ]) |
@@ -151,11 +153,12 @@ | ||
151 | 153 … | draw() |
152 | 154 … | }) |
153 | 155 … | |
154 | 156 … | function followFilter (msg) { |
155 | - if (!filterSettings().only.peopleIFollow) return true | |
157 … | + if (!filterSettings().only.peopleAndChannelsIFollow) return true | |
156 | 158 … | |
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)) | |
158 | 161 … | } |
159 | 162 … | |
160 | 163 … | function userFilter (msg) { |
161 | 164 … | if (!userId) return true |
Built with git-ssb-web