FIX: Hide Uncategorized unless allow_uncategorized_topics (PR #12889)

Uncategorized was sometimes visible even if allow_uncategorized_topics was false. This was especially happening on mobile, if at least one topic was uncategorized.


This pull request has been mentioned on Discourse Meta. There might be relevant details there:

Shouldn’t this be an or instead of removing the condition?

    @categories.delete_if { |c| c.uncategorized?  || c.displayable_topics.blank? }

I do not think so. Your solution would not display any empty categories, which I do not think is intended. Empty categories are rare, but possible in new forums.