Obtén el título del tema para mostrar en el banner personalizado

He estado usando el enrutador y el descubrimiento para crear un héroe dinámico dependiendo de la página que se muestra, sin embargo, cuando llego a una página de tema individual, no encuentro una manera de pasar el título del tema a la plantilla.

¿Hay alguna forma de recuperar el título del tema aquí?

import { inject as service } from "@ember/service";
import Component from "@glimmer/component";
import { defaultHomepage } from "discourse/lib/utilities";

export default class BcnHero extends Component {
  @service router;
  @service discovery;

  get showHero() {
    const { currentRouteName } = this.router;
    const { category } = this.discovery;

    let categoryName = "";
    let categoryDescription = "";
    if (category) {
      categoryName = category.name;
      categoryDescription = category.description;
    }

    if (currentRouteName === `discovery.${defaultHomepage()}`) {
      return { homepageHero: true };
    }

    if (currentRouteName === "discovery.category" || currentRouteName.startsWith("topic")) {
      return { dynamicHero: true, title: categoryName, subtitle: categoryDescription };
    }
    return { emptyHero: true };
  }
}
1 me gusta