Skip to content

A platform for community discussion. Free, open, simple.

FIX: correctly shows education text for categories

Joffrey JAFFEUX9260969101f7
diff --git a/app/assets/javascripts/discourse/controllers/discovery/topics.js.es6 b/app/assets/javascripts/discourse/controllers/discovery/topics.js.es6
index 8d3f4b4b86c..344b79baff6 100644
--- a/app/assets/javascripts/discourse/controllers/discovery/topics.js.es6
+++ b/app/assets/javascripts/discourse/controllers/discovery/topics.js.es6
@@ -137,11 +137,12 @@ const controllerOpts = {
footerEducation: function() {
if (!this.get('allLoaded') || this.get('model.topics.length') > 0 || !this.currentUser) { return; }
- const split = (this.get('model.filter') || '').split('/');
+ const segments = (this.get('model.filter') || '').split('/');
- if (split[0] !== 'new' && split[0] !== 'unread') { return; }
+ const tab = segments[segments.length - 1];
+ if (tab !== 'new' && tab !== 'unread') { return; }
- return I18n.t("topics.none.educate." + split[0], {
+ return I18n.t("topics.none.educate." + tab, {
userPrefsUrl: userPath(`${this.currentUser.get('username_lower')}/preferences`)
});
}.property('allLoaded', 'model.topics.length')