Commit a085e3fb authored by Phil Hughes's avatar Phil Hughes

Fixed resolved discussion timeago not rendering

Closes #24787
parent 0f590750
...@@ -57,14 +57,17 @@ class DiscussionModel { ...@@ -57,14 +57,17 @@ class DiscussionModel {
} }
updateHeadline (data) { updateHeadline (data) {
const $discussionHeadline = $(`.discussion[data-discussion-id="${this.id}"] .js-discussion-headline`); const discussionSelector = `.discussion[data-discussion-id="${this.id}"]`;
const $discussionHeadline = $(`${discussionSelector} .js-discussion-headline`);
if (data.discussion_headline_html) { if (data.discussion_headline_html) {
if ($discussionHeadline.length) { if ($discussionHeadline.length) {
$discussionHeadline.replaceWith(data.discussion_headline_html); $discussionHeadline.replaceWith(data.discussion_headline_html);
} else { } else {
$(`.discussion[data-discussion-id="${this.id}"] .discussion-header`).append(data.discussion_headline_html); $(`${discussionSelector} .discussion-header`).append(data.discussion_headline_html);
} }
gl.utils.localTimeAgo($('.js-timeago', `${discussionSelector}`));
} else { } else {
$discussionHeadline.remove(); $discussionHeadline.remove();
} }
...@@ -74,7 +77,7 @@ class DiscussionModel { ...@@ -74,7 +77,7 @@ class DiscussionModel {
if (!this.canResolve) { if (!this.canResolve) {
return false; return false;
} }
for (const noteId in this.notes) { for (const noteId in this.notes) {
const note = this.notes[noteId]; const note = this.notes[noteId];
......
---
title: Fixed timeago not rendering when resolving a discussion
merge_request:
author:
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment