FIX: do not show as clickable the thread header (#30005)

When the current user can't modify the thread title we shouldn't show it as a clickable area.
This commit is contained in:
Joffrey JAFFEUX 2024-11-30 00:32:58 +01:00 committed by GitHub
parent b546c31b7f
commit 877b03c7ae
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,6 +1,7 @@
import Component from "@glimmer/component";
import { on } from "@ember/modifier";
import { service } from "@ember/service";
import { or } from "truth-helpers";
import noop from "discourse/helpers/noop";
import replaceEmoji from "discourse/helpers/replace-emoji";
import icon from "discourse-common/helpers/d-icon";
@ -70,8 +71,6 @@ export default class ChatThreadHeader extends Component {
) {
return () =>
this.modal.show(ThreadSettingsModal, { model: this.args.thread });
} else {
return noop;
}
}
@ -92,9 +91,9 @@ export default class ChatThreadHeader extends Component {
<navbar.Title
@title={{replaceEmoji this.headerTitle}}
{{on "click" this.openThreadTitleModal}}
{{on "click" (or this.openThreadTitleModal noop)}}
role={{if this.openThreadTitleModal "button"}}
class="clickable"
class={{if this.openThreadTitleModal "clickable"}}
/>
<navbar.Actions as |action|>
<action.ThreadTrackingDropdown @thread={{@thread}} />