fix: Don't force unread view to only discussions (#149)
Allow using the unread filter with questions.
This commit is contained in:
@@ -219,16 +219,6 @@ describe('PostsView', () => {
|
||||
secondClick: 'Discussions',
|
||||
selected: ['Discussions', 'Any'],
|
||||
},
|
||||
{
|
||||
firstClick: 'Questions',
|
||||
secondClick: 'Unread',
|
||||
selected: ['Discussions', 'Unread'],
|
||||
},
|
||||
{
|
||||
firstClick: 'Unread',
|
||||
secondClick: 'Questions',
|
||||
selected: ['Questions', 'Any'],
|
||||
},
|
||||
])(
|
||||
'incompatible combinations',
|
||||
({
|
||||
|
||||
@@ -60,10 +60,9 @@ function PostFilterBar({
|
||||
if (name === 'type') {
|
||||
dispatch(setPostsTypeFilter(value));
|
||||
if (
|
||||
(value === ThreadType.DISCUSSION && currentStatus === PostsStatusFilter.UNANSWERED)
|
||||
|| (value === ThreadType.QUESTION && currentStatus === PostsStatusFilter.UNREAD)
|
||||
value === ThreadType.DISCUSSION && currentStatus === PostsStatusFilter.UNANSWERED
|
||||
) {
|
||||
// You can't filter discussions by unanswered or questions by unread
|
||||
// You can't filter discussions by unanswered
|
||||
dispatch(setStatusFilter(PostsStatusFilter.ALL));
|
||||
}
|
||||
}
|
||||
@@ -73,10 +72,6 @@ function PostFilterBar({
|
||||
// You can't filter discussions by unanswered so switch type to questions
|
||||
dispatch(setPostsTypeFilter(ThreadType.QUESTION));
|
||||
}
|
||||
if (value === PostsStatusFilter.UNREAD && currentType !== ThreadType.DISCUSSION) {
|
||||
// You can't filter questions by unread so switch type to discussion
|
||||
dispatch(setPostsTypeFilter(ThreadType.DISCUSSION));
|
||||
}
|
||||
}
|
||||
if (name === 'sort') {
|
||||
dispatch(setSortedBy(value));
|
||||
|
||||
Reference in New Issue
Block a user