FIX: correctly shows education text for categories

This commit is contained in:
Joffrey JAFFEUX
2018-03-29 10:33:44 +02:00
committed by GitHub
parent 3b3e6ed23f
commit 9260969101

View File

@@ -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')