mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 06:56:01 +08:00
UX: Stop taking you to user page when compose private message is called
This commit is contained in:
parent
e083fb44f4
commit
d7400dd10a
|
@ -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
|
||||
});
|
||||
},
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user