FIX: creating new message via link was failing for anon user

This commit is contained in:
Arpit Jalan 2018-01-24 11:45:15 +05:30
parent 3b083ca0bd
commit 65e80aba03
1 changed files with 3 additions and 2 deletions

View File

@ -4,10 +4,11 @@ import Group from 'discourse/models/group';
export default Discourse.Route.extend({ export default Discourse.Route.extend({
beforeModel(transition) { beforeModel(transition) {
const self = this;
const params = transition.queryParams; const params = transition.queryParams;
if (this.currentUser) { if (self.currentUser) {
this.replaceWith("discovery.latest").then(e => { self.replaceWith("discovery.latest").then(e => {
if (params.username) { if (params.username) {
// send a message to a user // send a message to a user
User.findByUsername(params.username).then(user => { User.findByUsername(params.username).then(user => {