From 0241ae41363d6f7f736e38d939ddd8eeb95dc6da Mon Sep 17 00:00:00 2001 From: Scott Feeney Date: Tue, 13 Aug 2013 14:41:06 -0400 Subject: [PATCH] Fix "All messages" showing when it shouldn't I haven't filed an issue about this since I just quickly found and tracked down the bug, but the STR were: 1. Subscribe to stream foo 2. Hide foo from your home view 3. Unsubscribe from stream foo 4. Unhide other subscribed streams you've hidden from home view, if any The "All messages" link would stay, although it should go away in this case. The apparent cause was an incorrect assumption (when implementing this feature) that the stream_info dict only contains subscribed streams; in fact, we also populate it with streams you used to subscribe to. (imported from commit 67f95c8c8a211a4943a2de394919d15a0d5435d0) --- static/js/subs.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/static/js/subs.js b/static/js/subs.js index 09a937b726..439dc1353f 100644 --- a/static/js/subs.js +++ b/static/js/subs.js @@ -42,7 +42,8 @@ exports.update_all_messages_link = function () { // the user has any subscriptions hidden from home view. var all_messages = $("#global_filters [data-name='all']")[0]; - if (_.every(stream_info.values(), function (sub) { return sub.in_home_view; })) { + if (_.every(_.where(stream_info.values(), {subscribed: true}), + function (sub) { return sub.in_home_view; })) { $(all_messages).addClass('hidden-filter'); } else { $(all_messages).removeClass('hidden-filter');