diff --git a/app/assets/javascripts/discourse/app/components/sidebar/messages-section.js b/app/assets/javascripts/discourse/app/components/sidebar/messages-section.js index 9c964bf4ab6..44ba8e23103 100644 --- a/app/assets/javascripts/discourse/app/components/sidebar/messages-section.js +++ b/app/assets/javascripts/discourse/app/components/sidebar/messages-section.js @@ -1,9 +1,6 @@ -import { action } from "@ember/object"; import { cached } from "@glimmer/tracking"; import GlimmerComponent from "discourse/components/glimmer"; -import Composer from "discourse/models/composer"; -import { getOwner } from "discourse-common/lib/get-owner"; import GroupMessageSectionLink from "discourse/lib/sidebar/messages-section/group-message-section-link"; import PersonalMessageSectionLink from "discourse/lib/sidebar/messages-section/personal-message-section-link"; @@ -90,14 +87,4 @@ export default class SidebarMessagesSection extends GlimmerComponent { return links; } - - @action - composePersonalMessage() { - const composerArgs = { - action: Composer.PRIVATE_MESSAGE, - draftKey: Composer.NEW_TOPIC_KEY, - }; - - getOwner(this).lookup("controller:composer").open(composerArgs); - } } diff --git a/app/assets/javascripts/discourse/app/templates/components/sidebar/messages-section.hbs b/app/assets/javascripts/discourse/app/templates/components/sidebar/messages-section.hbs index bed39761eff..f02235cd284 100644 --- a/app/assets/javascripts/discourse/app/templates/components/sidebar/messages-section.hbs +++ b/app/assets/javascripts/discourse/app/templates/components/sidebar/messages-section.hbs @@ -2,7 +2,7 @@ @sectionName="messages" @headerRoute="userPrivateMessages.index" @headerModel={{this.currentUser}} - @headerAction={{this.composePersonalMessage}} + @headerAction={{fn (route-action "composePrivateMessage") null null}} @headerActionIcon="plus" @headerLinkText={{i18n "sidebar.sections.messages.header_link_text"}} @headerLinkTitle={{i18n "sidebar.sections.messages.header_link_title"}} >