Fix 0s in notification dropdown

By casting the length int to a bool, if there are no badges, we don't display a  0. It seems that mithril will render integers, but not booleans.

Fixes https://github.com/flarum/QualityAssurance/issues/28
This commit is contained in:
Alexander Skvortsov 2021-05-14 21:08:48 -04:00
parent 8ffeac4315
commit d1e987a240

View File

@ -73,7 +73,7 @@ export default class NotificationList extends Component {
<div className="NotificationGroup">
{group.discussion ? (
<Link className="NotificationGroup-header" href={app.route.discussion(group.discussion)}>
{badges && badges.length && <ul className="NotificationGroup-badges badges">{listItems(badges)}</ul>}
{badges && !!badges.length && <ul className="NotificationGroup-badges badges">{listItems(badges)}</ul>}
<span>{group.discussion.title()}</span>
</Link>
) : (