mirror of
https://github.com/wassname/talk.git
synced 2026-06-28 18:45:55 +08:00
Comment edit is no longer extended one ach edit
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user