FIX: Don't show timeline when less than 3 posts
This commit is contained in:
parent
9e39474ef9
commit
a8ed7e9ceb
1 changed files with 21 additions and 14 deletions
|
@ -205,7 +205,11 @@ export default createWidget('topic-timeline', {
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
return [h('div.timeline-controls', controls),
|
|
||||||
|
const result = [ h('div.timeline-controls', controls) ];
|
||||||
|
const stream = attrs.topic.get('postStream.stream');
|
||||||
|
if (stream.length > 2) {
|
||||||
|
return result.concat([
|
||||||
this.attach('link', {
|
this.attach('link', {
|
||||||
className: 'start-date',
|
className: 'start-date',
|
||||||
rawLabel: tinyDateYear(createdAt),
|
rawLabel: tinyDateYear(createdAt),
|
||||||
|
@ -218,6 +222,9 @@ export default createWidget('topic-timeline', {
|
||||||
label: 'topic.timeline.now',
|
label: 'topic.timeline.now',
|
||||||
action: 'jumpBottom'
|
action: 'jumpBottom'
|
||||||
})
|
})
|
||||||
];
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Reference in a new issue