Discourse 카테고리 헤더 테마 컴포넌트

이 컴포넌트에 다음 설정이 적용될 때 데스크톱 및 모바일 브라우저에서 카테고리 페이지가 빈 화면으로 표시됩니다 (Discourse 버전 3.5.0.beta8-dev).

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

기본값(true)으로 되돌리면 페이지가 정상적으로 표시됩니다.

콘솔에 다음과 같은 오류가 표시됩니다…

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

…이는 다음과 관련이 있습니다…

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

…문제가 되는 부분은 아래 코드에서 3번째 줄(const hideMobile)입니다:

    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;
    }

이러한 문제가 발생하는 이유가 무엇일까요?

1개의 좋아요