mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix: don't update edit data if edited timestamp is not available
This commit is contained in:
@@ -142,19 +142,21 @@ define('forum/topic/events', [
|
|||||||
posts.addBlockquoteEllipses(editedPostEl.parent());
|
posts.addBlockquoteEllipses(editedPostEl.parent());
|
||||||
editedPostEl.fadeIn(250);
|
editedPostEl.fadeIn(250);
|
||||||
|
|
||||||
const editData = {
|
if (data.post.edited) {
|
||||||
editor: data.editor,
|
const editData = {
|
||||||
editedISO: utils.toISOString(data.post.edited),
|
editor: data.editor,
|
||||||
};
|
editedISO: utils.toISOString(data.post.edited),
|
||||||
|
};
|
||||||
|
|
||||||
app.parseAndTranslate('partials/topic/post-editor', editData, function (html) {
|
app.parseAndTranslate('partials/topic/post-editor', editData, function (html) {
|
||||||
editorEl.replaceWith(html);
|
editorEl.replaceWith(html);
|
||||||
postContainer.find('[component="post/edit-indicator"]')
|
postContainer.find('[component="post/edit-indicator"]')
|
||||||
.removeClass('hidden')
|
.removeClass('hidden')
|
||||||
.translateAttr('title', `[[global:edited-timestamp, ${editData.editedISO}]]`);
|
.translateAttr('title', `[[global:edited-timestamp, ${editData.editedISO}]]`);
|
||||||
postContainer.find('[component="post/editor"] .timeago').timeago();
|
postContainer.find('[component="post/editor"] .timeago').timeago();
|
||||||
hooks.fire('action:posts.edited', data);
|
hooks.fire('action:posts.edited', data);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
hooks.fire('action:posts.edited', data);
|
hooks.fire('action:posts.edited', data);
|
||||||
|
|||||||
Reference in New Issue
Block a user