mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 17:46:05 -05:00
FIX: New posts should update the last post date
This commit is contained in:
parent
cc11c352cf
commit
158a0daf32
2 changed files with 3 additions and 3 deletions
|
@ -696,6 +696,7 @@ export default RestModel.extend({
|
||||||
const postNumber = post.get('post_number');
|
const postNumber = post.get('post_number');
|
||||||
if (postNumber && postNumber > (this.get('topic.highest_post_number') || 0)) {
|
if (postNumber && postNumber > (this.get('topic.highest_post_number') || 0)) {
|
||||||
this.set('topic.highest_post_number', postNumber);
|
this.set('topic.highest_post_number', postNumber);
|
||||||
|
this.set('topic.last_posted_at', post.get('created_at'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (existing) {
|
if (existing) {
|
||||||
|
|
|
@ -212,13 +212,13 @@ export default createWidget('topic-timeline', {
|
||||||
|
|
||||||
if (stream.length < 3) { return; }
|
if (stream.length < 3) { return; }
|
||||||
|
|
||||||
const rawLabel = relativeAge(new Date(topic.last_posted_at), { addAgo: true, defaultFormat: timelineDate });
|
|
||||||
|
|
||||||
let result = [];
|
let result = [];
|
||||||
if (currentUser && currentUser.get('canManageTopic')) {
|
if (currentUser && currentUser.get('canManageTopic')) {
|
||||||
result.push(h('div.timeline-controls', this.attach('topic-admin-menu-button', { topic })));
|
result.push(h('div.timeline-controls', this.attach('topic-admin-menu-button', { topic })));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const bottomAge = relativeAge(new Date(topic.last_posted_at), { addAgo: true, defaultFormat: timelineDate });
|
||||||
result = result.concat([this.attach('link', {
|
result = result.concat([this.attach('link', {
|
||||||
className: 'start-date',
|
className: 'start-date',
|
||||||
rawLabel: timelineDate(createdAt),
|
rawLabel: timelineDate(createdAt),
|
||||||
|
@ -227,8 +227,7 @@ export default createWidget('topic-timeline', {
|
||||||
this.attach('timeline-scrollarea', attrs),
|
this.attach('timeline-scrollarea', attrs),
|
||||||
this.attach('link', {
|
this.attach('link', {
|
||||||
className: 'now-date',
|
className: 'now-date',
|
||||||
icon: 'dot-circle-o',
|
rawLabel: bottomAge,
|
||||||
rawLabel,
|
|
||||||
action: 'jumpBottom'
|
action: 'jumpBottom'
|
||||||
})]);
|
})]);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue