 angular.module('loomioApp').factory 'IntercomService', ($rootScope, $window, AppConfig, Session, LmoUrlService) ->
-  currentGroup = null
+  lastGroup = {}
+
   mapGroup = (group) ->
     return null unless group?
     id: group.id

    boot: ->
      return unless $window? and $window.Intercom?
      user = Session.user()
      firstGroup = user.parentGroups()[0]

      $window.Intercom 'boot',
       admin_link: LmoUrlService.user(user, {}, { noStub: true, absolute: true, namespace: 'admin/users', key: 'id' })

       user_id: user.id
       created_at: user.createdAt
       is_coordinator: user.isCoordinator
       locale: user.locale
       company: lastGroup
       has_profile_photo: user.hasProfilePhoto()
       belongs_to_paying_group: user.belongsToPayingGroup()

