FIX: missing in action wrench on short topics

This commit is contained in:
Sam 2016-06-22 10:56:23 +10:00
parent 7337b2953f
commit 3701a8ada2
1 changed files with 4 additions and 2 deletions

View File

@ -209,14 +209,16 @@ export default createWidget('topic-timeline', {
const stream = attrs.topic.get('postStream.stream'); const stream = attrs.topic.get('postStream.stream');
const { currentUser } = this; const { currentUser } = this;
if (stream.length < 3) { return; }
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 })));
} }
if (stream.length < 3) {
return result;
}
const bottomAge = relativeAge(new Date(topic.last_posted_at), { addAgo: true, defaultFormat: timelineDate }); 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',