Comment edit is no longer extended one ach edit

This commit is contained in:
Benjamin Goering
2017-05-03 14:17:36 -07:00
parent 3cb84222b2
commit c3f3ed8a50
+2 -6
View File
@@ -104,12 +104,8 @@ module.exports = class CommentsService {
* @returns {Date} last date at which comment can be edited
*/
static getEditableUntilDate(comment) {
const mostRecentEditDate = (comment) => {
const {created_at, body_history} = comment;
const lastEdit = body_history[body_history.length - 1];
return (lastEdit && lastEdit.created_at) || created_at;
};
return new Date(Number(mostRecentEditDate(comment)) + EDIT_WINDOW_MS);
const {created_at} = comment;
return new Date(Number(created_at) + EDIT_WINDOW_MS);
}
/**