Discourse Category Headers theme component

I’m also getting blank category pages on desktop and mobile browsers (Discourse version 3.5.0.beta8-dev) when this component has the following setting:

  "setting": "show_mobile",
  "value": false

When I reset it to default (true) the pages show correctly.

Console shows the following error…

Unhandled Promise Rejection: TypeError: undefined is not an object (evaluating ‘this.site.mobileView’)

…which relates to…

/discourse/theme-javascripts/theme-3/discourse/components/category-header.gjs)

…and the offending line is line 3 (const hideMobile) below:

    get showHeader() {
      const isException = this.args.category && settings.hide_category_exceptions.split("|").includes(String(this.args.category.id));
      const hideMobile = !settings.show_mobile && this.site.mobileView;
      const subCat = !settings.show_subcategory_header && this.args.category.parentCategory;
      const noDesc = !settings.hide_if_no_category_description && !this.args.category.description_text;
      const path = window.location.pathname;
      return /^\/c\//.test(path) && !isException && !noDesc && !subCat && !hideMobile;
    }

Any clue as to why this is happening?

1 Like