     else @render()
   onBeforeAction: ->
     if getUser()
-      if not amIValid() then Router.go 'verifyEmail' else Router.go 'home'
+      if amIValid() is no then Router.go 'verifyEmail' else Router.go 'notes'
+
 
 Router.map ->
   @route 'home',
     path: '/'
     template: 'homepage'
-    action: -> @render 'homepage', to: 'outside'
+    action: ->
+      if Meteor.status().connected is no
+        @render 'reconnect'
+      else @render 'homepage', to: 'outside'
     onBeforeAction: ->
       # Dispatch user to the right landing page based on his account status
       if getUser()

    else @render()
  onBeforeAction: ->
    if not getUser() then Router.go 'home'
    if not amIValid() then Router.go 'verifyEmail'
guestController = RouteController.extend
  action: ->
    if Meteor.status().connected is no

  return yes for mail in getUser().emails when mail.verified is yes; no

# Common Helpers for the Templates
UI.registerHelper "version", -> "1.1.2"
UI.registerHelper "status", -> Meteor.status()
UI.registerHelper "loading", -> Meteor.loggingIn() or !Meteor.status().connected
UI.registerHelper "email", ->
