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 {
}
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 ($discussionHeadline.length) {
$discussionHeadline.replaceWith(data.discussion_headline_html);
} 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 {
$discussionHeadline.remove();
}
......
---
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