     updateWithGroup: (group) ->
       return unless @available()
       user = Session.user()
-      return if currentGroup == group
+      return if _.isEqual(lastGroup, mapGroup(group))
       return if group.isSubgroup()
       return if !user.isMemberOf(group)
-      currentGroup = group
+      lastGroup = mapGroup(group)
       $window.Intercom 'update',
         email: user.email
         user_id: user.id
-        company: mapGroup(group)
+        company: lastGroup
 
     contactUs: ->
       if @available()

    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' })

angular.module('loomioApp').factory 'IntercomService', ($rootScope, $window, AppConfig, Session, LmoUrlService) ->
  lastGroup = {}

  mapGroup = (group) ->
    return null unless group?
    id: group.id
