     talkClient.put '/notifications/read'
     for notification in @state.notifications
       notification.update delivered: true
-    @forceUpdate()
+    @setState unreadCount: 0
 
   title: ->
     if @props.project

  render: ->
    <div className="talk notifications">
      <div className="content-container">
        <h1 className={"centering title #{ if @props.project then 'talk-module' else '' }"}>
          {@title()}
        </h1>



      @setState {notifications, notificationsMap, firstMeta, lastMeta}

  notificationsQuery: (page = @props.query.page, options = { }) ->
    page or= 1
    query = Object.assign { }, options, {page}
    query.section = "project-#{ @props.project.id }" if @props.project
    query.section = @props.params.section if @props.params.section
    query

  getUnreadCount: ->
    talkClient.type('notifications').get(@notificationsQuery(1, page_size: 1, delivered: false)).then (notifications) =>
      unreadCount = notifications[0]?.getMeta()?.count or 0
      @setState {unreadCount}

  markAsRead: (meta) ->
    =>
      ids = @state["#{ meta }Meta"].notificationIds
