UX: Don't show more notifications message when there is none.

This commit is contained in:
Guo Xiang Tan 2016-07-07 17:42:18 +08:00
parent 21684c98be
commit 6684e4ab87
No known key found for this signature in database
GPG Key ID: 19C321C8952B0F72
2 changed files with 10 additions and 7 deletions

View File

@ -75,7 +75,6 @@ export default createWidget('user-menu', {
return [this.attach('user-menu-links', { path }),
this.attach('user-notifications', { path }),
h('div.logout-link', [
h('hr'),
h('ul.menu-links',
h('li', this.attach('link', { action: 'logout',
className: 'logout',

View File

@ -67,13 +67,17 @@ export default createWidget('user-notifications', {
const href = `${attrs.path}/notifications`;
result.push(h('hr'));
result.push(h('ul', [
notificationItems,
h('li.read.last.heading',
h('a', { attributes: { href } }, [I18n.t('notifications.more'), '...'])
)
]));
const items = [notificationItems]
if (notificationItems.length > 0) {
items.push(
h('li.read.last.heading', h('a', { attributes: { href } }, [I18n.t('notifications.more'), '...'])),
h('hr')
);
}
result.push(h('ul', items));
}
return result;