Skip to content
Snippets Groups Projects
Commit de90a2d2 authored by Rodrigo Nascimento's avatar Rodrigo Nascimento
Browse files

Redirect user to the defaultRoom if setted

parent 55186d9f
No related branches found
No related tags found
No related merge requests found
......@@ -16,7 +16,19 @@ FlowRouter.route '/',
name: 'index'
action: ->
FlowRouter.go 'home'
BlazeLayout.render 'main', {center: 'loading'}
if not Meteor.userId()
return FlowRouter.go 'home'
Tracker.autorun (c) ->
if FlowRouter.subsReady() is true
Meteor.defer ->
if Meteor.user().defaultRoom?
room = Meteor.user().defaultRoom.split('/')
FlowRouter.go room[0], {name: room[1]}
else
FlowRouter.go 'home'
c.stop()
FlowRouter.route '/login',
......
......@@ -15,4 +15,5 @@ Meteor.publish 'userData', ->
admin: 1
utcOffset: 1
language: 1
settings: 1
\ No newline at end of file
settings: 1
defaultRoom: 1
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment