From d7400dd10aacfc53bb9defcff9d264eb06ce8f5c Mon Sep 17 00:00:00 2001 From: Sam Date: Mon, 15 Feb 2016 20:27:29 +1100 Subject: [PATCH] UX: Stop taking you to user page when compose private message is called --- .../discourse/routes/application.js.es6 | 15 ++++++++++++--- .../javascripts/discourse/routes/user.js.es6 | 15 --------------- 2 files changed, 12 insertions(+), 18 deletions(-) diff --git a/app/assets/javascripts/discourse/routes/application.js.es6 b/app/assets/javascripts/discourse/routes/application.js.es6 index 8c1637b7aff..0ace34b5bb9 100644 --- a/app/assets/javascripts/discourse/routes/application.js.es6 +++ b/app/assets/javascripts/discourse/routes/application.js.es6 @@ -53,9 +53,18 @@ const ApplicationRoute = Discourse.Route.extend(OpenComposer, { }, composePrivateMessage(user, post) { - const self = this; - this.transitionTo('userActivity', user).then(function () { - self.controllerFor('user-activity').send('composePrivateMessage', user, post); + + const recipient = user ? user.get('username') : '', + reply = post ? window.location.protocol + "//" + window.location.host + post.get("url") : null; + + // used only once, one less dependency + const Composer = require('discourse/models/composer').default; + return this.controllerFor('composer').open({ + action: Composer.PRIVATE_MESSAGE, + usernames: recipient, + archetypeId: 'private_message', + draftKey: 'new_private_message', + reply: reply }); }, diff --git a/app/assets/javascripts/discourse/routes/user.js.es6 b/app/assets/javascripts/discourse/routes/user.js.es6 index 71e803300d0..271dfad4790 100644 --- a/app/assets/javascripts/discourse/routes/user.js.es6 +++ b/app/assets/javascripts/discourse/routes/user.js.es6 @@ -11,21 +11,6 @@ export default Discourse.Route.extend({ }, actions: { - composePrivateMessage(user, post) { - const recipient = user ? user.get('username') : '', - reply = post ? window.location.protocol + "//" + window.location.host + post.get("url") : null; - - // used only once, one less dependency - const Composer = require('discourse/models/composer').default; - return this.controllerFor('composer').open({ - action: Composer.PRIVATE_MESSAGE, - usernames: recipient, - archetypeId: 'private_message', - draftKey: 'new_private_message', - reply: reply - }); - }, - willTransition(transition) { // will reset the indexStream when transitioning to routes that aren't "indexStream" // otherwise the "header" will jump