Commit 57ede789ed0c6b572f9e213d61e7fe18428a643b
Fix follow filter, make isfiltered work again
Anders Rune Jensen authored on 9/18/2017, 7:06:13 PMmix irving committed on 10/27/2017, 4:57:33 AM
Parent: e2c1d29fd59c7f5fa88e9d4e8e526de67e61915f
Files changed
app/html/filter.js | changed |
app/sync/initialise/settings.js | changed |
app/html/filter.js | ||
---|---|---|
@@ -5,8 +5,9 @@ | ||
5 | 5 … | const addSuggest = require('suggest-box') |
6 | 6 … | const { isFeed } = require('ssb-ref') |
7 | 7 … | const some = require('lodash/some') |
8 | 8 … | const get = require('lodash/get') |
9 … | +const isEqual = require('lodash/isEqual') | |
9 | 10 … | |
10 | 11 … | exports.gives = nest('app.html.filter') |
11 | 12 … | |
12 | 13 … | exports.needs = nest({ |
@@ -35,15 +36,11 @@ | ||
35 | 36 … | const filterSettings = api.settings.obs.get('filter') |
36 | 37 … | |
37 | 38 … | // this needs to show if the filter has changed from default ?...? |
38 | 39 … | const isFiltered = computed([onlyAuthor, filterSettings], (onlyAuthor, filterSettings) => { |
39 | - return onlyAuthor || filterSettings.only.peopleIFollow || some(filterSettings.show, false) | |
40 … | + return onlyAuthor || filterSettings.only.peopleIFollow || !isEqual(filterSettings.show, filterSettings.defaults.show) | |
40 | 41 … | }) |
41 | 42 … | |
42 | - // const isFiltered = computed([onlyPeopleIFollow, onlyAuthor, showPost, showAbout, showVote, showContact, showChannel, showPub, showChess], (onlyPeopleIFollow, onlyAuthor, showPost, showAbout, showVote, showContact, showChannel, showPub) => { | |
43 | - // return onlyPeopleIFollow || onlyAuthor || !showPost || !showAbout || showVote || showContact || showChannel || showPub || !showChess | |
44 | - // }) | |
45 | - | |
46 | 43 … | const authorInput = h('input', { |
47 | 44 … | 'ev-keyup': (ev) => { |
48 | 45 … | const author = ev.target.value |
49 | 46 … | if (author && !isFeed(author)) return |
@@ -56,10 +53,9 @@ | ||
56 | 53 … | const filterMenu = h('Filter', [ |
57 | 54 … | h('i', { |
58 | 55 … | classList: when(showFilters, |
59 | 56 … | 'fa fa-filter -active', |
60 | - 'fa fa-filter' | |
61 | - // when(isFiltered, 'fa fa-filter -filtered', 'fa fa-filter') | |
57 … | + when(isFiltered, 'fa fa-filter -filtered', 'fa fa-filter') | |
62 | 58 … | ), |
63 | 59 … | 'ev-click': () => showFilters.set(!showFilters()) |
64 | 60 … | }), |
65 | 61 … | h('i.fa.fa-angle-up', { 'ev-click': draw }), |
@@ -72,9 +68,9 @@ | ||
72 | 68 … | h('div.author', [ |
73 | 69 … | h('label', 'Show author'), |
74 | 70 … | authorInput |
75 | 71 … | ]), |
76 | - toggle({ type: 'peopleIfollow', filterGroup: 'only', label: 'Only people I follow' }), | |
72 … | + toggle({ type: 'peopleIFollow', filterGroup: 'only', label: 'Only people I follow' }), | |
77 | 73 … | h('div.message-types', [ |
78 | 74 … | h('header', 'Show messages'), |
79 | 75 … | toggle({ type: 'post' }), |
80 | 76 … | toggle({ type: 'like' }), |
Built with git-ssb-web