From b3d6cefef492738af953d67547a7f86203fcedc3 Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 4 Sep 2015 17:22:26 +1000 Subject: [PATCH] FIX: never ask for less than 5 notifications --- app/assets/javascripts/discourse/components/user-menu.js.es6 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/assets/javascripts/discourse/components/user-menu.js.es6 b/app/assets/javascripts/discourse/components/user-menu.js.es6 index 7815295ef20..d934e9295b5 100644 --- a/app/assets/javascripts/discourse/components/user-menu.js.es6 +++ b/app/assets/javascripts/discourse/components/user-menu.js.es6 @@ -46,6 +46,9 @@ export default Ember.Component.extend({ // estimate (poorly) the amount of notifications to return const limit = Math.round(($(window).height() - headerHeight()) / 50); + // we REALLY don't want to be asking for negative counts of notifications + // less than 5 is also not that useful + if (limit < 5) { limit = 5; } // TODO: It's a bit odd to use the store in a component, but this one really // wants to reach out and grab notifications