mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 22:43:33 +08:00
UX: Don't show more notifications message when there is none.
This commit is contained in:
@ -75,7 +75,6 @@ export default createWidget('user-menu', {
|
|||||||
return [this.attach('user-menu-links', { path }),
|
return [this.attach('user-menu-links', { path }),
|
||||||
this.attach('user-notifications', { path }),
|
this.attach('user-notifications', { path }),
|
||||||
h('div.logout-link', [
|
h('div.logout-link', [
|
||||||
h('hr'),
|
|
||||||
h('ul.menu-links',
|
h('ul.menu-links',
|
||||||
h('li', this.attach('link', { action: 'logout',
|
h('li', this.attach('link', { action: 'logout',
|
||||||
className: 'logout',
|
className: 'logout',
|
||||||
|
@ -67,13 +67,17 @@ export default createWidget('user-notifications', {
|
|||||||
const href = `${attrs.path}/notifications`;
|
const href = `${attrs.path}/notifications`;
|
||||||
|
|
||||||
result.push(h('hr'));
|
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;
|
return result;
|
||||||
|
Reference in New Issue
Block a user