Skip to content

Commit 095d429

Browse files
fix: fixed Learner Post filter issue (#651)
* fix: fixed Learner Post filter issue * refactor: removed different variable declaration --------- Co-authored-by: Awais Ansari <[email protected]>
1 parent fa83570 commit 095d429

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/discussions/learners/learner-post-filter-bar/LearnerPostFilterBar.jsx

+7
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { useParams } from 'react-router-dom';
77
import { sendTrackEvent } from '@edx/frontend-platform/analytics';
88

99
import FilterBar from '../../../components/FilterBar';
10+
import { PostsStatusFilter, ThreadType } from '../../../data/constants';
1011
import { selectCourseCohorts } from '../../cohorts/data/selectors';
1112
import { fetchCourseCohorts } from '../../cohorts/data/thunks';
1213
import { selectUserHasModerationPrivileges, selectUserIsGroupTa } from '../../data/selectors';
@@ -58,10 +59,16 @@ const LearnerPostFilterBar = () => {
5859
}
5960
} else if (name === 'status') {
6061
if (postFilter.status !== value) {
62+
const postType = (value === PostsStatusFilter.UNANSWERED && ThreadType.QUESTION)
63+
|| (value === PostsStatusFilter.UNRESPONDED && ThreadType.DISCUSSION)
64+
|| postFilter.postType;
65+
6166
dispatch(setPostFilter({
6267
...postFilter,
68+
postType,
6369
status: value,
6470
}));
71+
6572
filterContentEventProperties.statusFilter = value;
6673
}
6774
} else if (name === 'orderBy') {

0 commit comments

Comments
 (0)