       switch state
         when Stopping, Terminating then @deselect()
         when Terminated then @destroy()
+
+
+  setUnreadCount: (channelId, count) ->
+
+    return  unless workspaceItem = @getWorkspaceItemByChannelId channelId
+
+    workspaceItem.setUnreadCount count
+
+    @updateUnreadCount()
+
+    return  unless count is 0
+
+    kd.singletons.socialapi.channel.updateLastSeenTime {channelId}, kd.noop
+
+
+  updateUnreadCount: ->
+
+    @unreadCount = 0
+
+    for own _, workspaceItem of @workspaceListItemsById
+      @unreadCount += workspaceItem.unreadCount or 0
+
+    @unreadIndicator.updatePartial @unreadCount
+    if @isListCollapsed and @unreadCount > 0
+      @unreadIndicator.show()


    @listWrapper.hide()
    @workspacesLabel.hide()
    @isListCollapsed = yes




    @listWrapper.show()
    @workspacesLabel.show()
    @unreadIndicator.hide()
    @isListCollapsed = no


