FIX: Check for staff without triggering anonymous user error (#20819)

Followup to 142d2ab65ecf31a1df1d0cd23e533d84c120b683
This commit is contained in:
David Taylor 2023-03-24 19:11:57 +00:00 committed by GitHub
parent ef0016cdba
commit e47af9bb72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,6 +3,11 @@ import hbs from "discourse/widgets/hbs-compiler";
createWidget("header-contents", {
tagName: "div.contents.clearfix",
transform() {
return {
staff: this.get("currentUser.staff"),
};
},
template: hbs`
{{#if this.site.desktopView}}
{{#if attrs.sidebarEnabled}}
@ -15,7 +20,7 @@ createWidget("header-contents", {
{{#if attrs.topic}}
{{header-topic-info attrs=attrs}}
{{else if this.siteSettings.bootstrap_mode_enabled}}
{{#if this.currentUser.staff}}
{{#if transformed.staff}}
{{header-bootstrap-mode attrs=attrs}}
{{/if}}
{{/if}}