     selectedThread: ActivityFlux.getters.selectedChannelThread
 
 
+  # if user clicks on channel in the list, modal will be closed
+  # and user will be redirected to channel's page.
+  # In this case we don't need to handle onClose event
+  onItemClick: (event) -> @skipCloseHandling = yes
+
+
   onClose: ->
 
+    return  @skipCloseHandling = no  if @skipCloseHandling
     return  unless @state.selectedThread
 
     channel = @state.selectedThread.get('channel').toJS()

  render: ->

    title = 'Other Messages:'
    <Modal className='ChannelList-Modal' isOpen={yes} onClose={@bound 'onClose'}>
      <SidebarModalList
        title={title}
        searchProp='name'
        threads={@state.threads}
        onThresholdAction='loadFollowedPrivateChannels'
        itemComponent={PrivateChannelListItem}/>
    </Modal>


KDReactorMixin = require 'app/flux/reactormixin'
ActivityFlux = require 'activity/flux'
isPublicChannel = require 'app/util/isPublicChannel'
PrivateChannelListItem = require 'activity/components/privatechannellistitem'


module.exports = class BrowsePrivateChannelsModal extends React.Component
