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({
beforeModel(transition) {
const self = this;
const params = transition.queryParams;
if (this.currentUser) {
this.replaceWith("discovery.latest").then(e => {
if (self.currentUser) {
self.replaceWith("discovery.latest").then(e => {
if (params.username) {
// send a message to a user
User.findByUsername(params.username).then(user => {