refactor(ui): Removed badge.count option from PluginApi

This commit is contained in:
Guillaume Chau
2018-04-22 13:35:13 +02:00
parent 9d00eebb92
commit 1781654df7
2 changed files with 2 additions and 3 deletions
@@ -11,7 +11,6 @@ const badgeSchema = createSchema(joi => ({
id: joi.string().required(),
type: joi.string(),
label: joi.string().required(),
count: joi.number().integer(),
priority: joi.number().integer(),
hidden: joi.boolean()
}))
@@ -69,12 +69,12 @@ function addBadge ({ routeId, badge }, context) {
const existingBadge = route.badges.find(b => b.id === badge.id)
if (existingBadge) {
Object.assign(existingBadge, badge, {
count: existingBadge.count + (badge.count || 1)
count: existingBadge.count + 1
})
} else {
route.badges.push({
type: 'dim',
count: (badge.count || 1),
count: 1,
priority: 0,
hidden: false,
...badge