         width  = window.innerWidth  or document.documentElement.clientWidth
         return rect.bottom <= ( height + 0 ) and rect.top >= 0
 
-    _loadNext: =>
-        if isVisible(@refs.nextPage.getDOMNode(), true)
-            scrollable.removeEventListener 'scroll', loadNext
+    _loadNext: ->
+        if @refs.nextPage? and @_isVisible(@refs.nextPage.getDOMNode(), true)
+            @setState loading: true
             LayoutActionCreator.showMessageList parameters: @props.query
-            #@redirect @props.paginationUrl
 
     _initScroll: ->
         if not @refs.nextPage?


        # listen to scroll events
        scrollable = @refs.list.getDOMNode().parentNode
        setTimeout ->
            scrollable.removeEventListener 'scroll', @_loadNext
            scrollable.addEventListener 'scroll', @_loadNext
        , 0

    getInitialState: ->
        return {
            edited: false
            loading: false
        }

    componentWillReceiveProps: (props) ->
        @setState loading: false
        if props.mailboxID isnt @props.mailboxID
            @setState edited: false
            @_selected = {}
