Revert "DEV: Update how we determine the presence of a topic in the header (#27138)" (#27234)

This reverts commit caa29ec973.
This commit is contained in:
Sérgio Saquetim 2024-05-28 21:48:55 -03:00 committed by GitHub
parent 6a1b9a7d2c
commit 3a2319be2b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 6 additions and 10 deletions

View File

@ -56,7 +56,7 @@ export default Component.extend(Scrolling, MobileScrollDirection, {
_hideTopicInHeader() {
this.appEvents.trigger("header:hide-topic");
this.header.inTopic = false;
this.header.topic = null;
this._lastShowTopic = false;
},
@ -65,7 +65,7 @@ export default Component.extend(Scrolling, MobileScrollDirection, {
return;
}
this.appEvents.trigger("header:show-topic", topic);
this.header.inTopic = true;
this.header.topic = topic;
this._lastShowTopic = true;
},

View File

@ -242,7 +242,7 @@ export default class GlimmerHeader extends Component {
</div>
<PluginOutlet
@name="after-header"
@outletArgs={{hash minimized=this.header.inTopic}}
@outletArgs={{hash minimized=(globalThis.Boolean this.header.topic)}}
/>
</header>
</template>

View File

@ -8,7 +8,7 @@ export default class AuthButtons extends Component {
<template>
<span class="auth-buttons">
{{#if (and @canSignUp (not this.header.inTopic))}}
{{#if (and @canSignUp (not this.header.topic))}}
<DButton
class="btn-primary btn-small sign-up-button"
@action={{@showCreateAccount}}

View File

@ -16,7 +16,7 @@ export default class Contents extends Component {
@service sidebarState;
get topicPresent() {
return this.header.inTopic;
return !!this.header.topic;
}
get sidebarIcon() {
@ -45,7 +45,7 @@ export default class Contents extends Component {
</PluginOutlet>
</div>
{{#if this.header.inTopic}}
{{#if this.header.topic}}
<TopicInfo @topic={{this.header.topic}} />
{{else if
(and

View File

@ -10,7 +10,6 @@ import { isTesting } from "discourse-common/config/environment";
// This route is used for retrieving a topic based on params
export default DiscourseRoute.extend({
composer: service(),
header: service(),
// Avoid default model hook
model(params) {
@ -45,8 +44,6 @@ export default DiscourseRoute.extend({
if (topic.isPrivateMessage && topic.suggested_topics) {
this.pmTopicTrackingState.startTracking();
}
this.header.topic = topic;
},
deactivate() {

View File

@ -7,7 +7,6 @@ export default class Header extends Service {
@service siteSettings;
@tracked topic = null;
@tracked inTopic = false;
@tracked hamburgerVisible = false;
@tracked userVisible = false;
@tracked anyWidgetHeaderOverrides = false;