FIX: render page title on tag routes (#24474)

This commit is contained in:
Kris 2023-11-20 18:30:17 -05:00 committed by GitHub
parent aff3d36f35
commit a48c43dfae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -170,26 +170,26 @@ export default class TagShowRoute extends DiscourseRoute {
const filterText = I18n.t(
`filters.${this.navMode.replace("/", ".")}.title`
);
const controller = this.controllerFor(this.controllerName);
const model = this.currentModel;
if (controller.tag?.id) {
if (controller.category) {
if (model?.tag?.id) {
if (model.category) {
return I18n.t("tagging.filters.with_category", {
filter: filterText,
tag: controller.tag.id,
category: controller.category.name,
tag: model.tag.id,
category: model.category.name,
});
} else {
return I18n.t("tagging.filters.without_category", {
filter: filterText,
tag: controller.tag.id,
tag: model.tag.id,
});
}
} else {
if (controller.category) {
if (model.category) {
return I18n.t("tagging.filters.untagged_with_category", {
filter: filterText,
category: controller.category.name,
category: model.category.name,
});
} else {
return I18n.t("tagging.filters.untagged_without_category", {