From 845d5445170a72f9b8e21e5b41c4f014210a9bad Mon Sep 17 00:00:00 2001 From: Thomas Kranitsas Date: Tue, 26 Dec 2017 22:35:32 +0200 Subject: [PATCH] Remove global notifications section if is 0 --- src/routes/notifications/helpers/notifications.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/routes/notifications/helpers/notifications.js b/src/routes/notifications/helpers/notifications.js index a71d4ea7a..2907cb44a 100644 --- a/src/routes/notifications/helpers/notifications.js +++ b/src/routes/notifications/helpers/notifications.js @@ -18,9 +18,11 @@ const MILLISECONDS_IN_MINUTE = 60000 export const getNotificationsFilters = (sources) => { const globalNotificationsQuantity = _.find(sources, { id: 'global' }).total const filterSections = [ - [{ title: 'All Notifications', value: '' }], - [{ title: 'Global', value: 'global', quantity: globalNotificationsQuantity }] + [{ title: 'All Notifications', value: '' }] ] + if (globalNotificationsQuantity > 0) { + filterSections.push([{ title: 'Global', value: 'global', quantity: globalNotificationsQuantity }]) + } const filtersBySource = [] sources.forEach(source => {