FIX: New posts should update the last post date

This commit is contained in:
Robin Ward 2016-06-01 13:44:40 -04:00
parent cc11c352cf
commit 158a0daf32
No known key found for this signature in database
GPG key ID: 0E091E2B4ED1B83D
2 changed files with 3 additions and 3 deletions

View file

@ -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) {

View file

@ -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'
})]); })]);