Skip to content

Commit

Permalink
MMI-3103 Updated content commentary timeout filter (#2393)
Browse files Browse the repository at this point in the history
* MMI-3103 Updated content commentary timeout filter

- updated content commentary timeout filter to be
based on the commentary action updated on time
  • Loading branch information
laidaoyu authored Jan 27, 2025
1 parent 478cec7 commit 06f2092
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,15 @@ export const filterCommentaryResults = (
return results.filter((content) => {
const postedCutoff = determineCommentaryTime(commentaryActionId, content.actions);
const publishedCutoff = moment().subtract(1, 'month');
let commentaryUpdatedOn = null;
// use the commentary action updated on time to decide if the content should be shown in the commentary list
const commentaryAction = content.actions.find((a) => a.id === commentaryActionId);
if (commentaryAction) {
commentaryUpdatedOn = commentaryAction.updatedOn;
}
return (
content.postedOn &&
moment(content.postedOn) >= moment(postedCutoff) &&
commentaryUpdatedOn &&
moment(commentaryUpdatedOn) >= moment(postedCutoff) &&
moment(content.publishedOn) >= publishedCutoff
);
});
Expand Down

0 comments on commit 06f2092

Please sign in to comment.