 
     previous_page : ->
         if @props.page > 0
-            @props.actions.setTo(page: @props.page-1)
+            @props.actions.setState(page: @props.page-1)
 
     next_page : ->
-        @props.actions.setTo(page: @props.page+1)
+        @props.actions.setState(page: @props.page+1)
 
     process_log_entry : (x, users) ->
         x.search = search_string(x, users)


    keydown : (e) ->
        if e.keyCode == 27
            @props.actions.setTo(search:'', page:0)

    on_change : (e) ->
        e.preventDefault()
        x = @refs.project_log_search.getValue()
        @props.actions.setTo(search : x, page : 0)

    render : ->
        <form onSubmit={@do_open_selected}>

    render : ->
        <div>
            <h1><Icon name='history' /> Project activity log</h1>
            {if @props.redux and @props.project_log then @render_log_panel() else <Loading/>}
        </div>

render = (project_id, redux) ->
    store   = redux.getProjectStore(project_id)
    actions = redux.getProjectActions(project_id)
    C = ProjectLog(store.name)
    <Redux redux={redux} connectToStores={[store.name, 'users']}>
        <C actions={actions} redux={redux} />
    </Redux>

exports.render_log = (project_id, dom_node, redux) ->
    #console.log("mount project_log")
    ReactDOM.render(render(project_id, redux), dom_node)

exports.unmount = (dom_node) ->
    #console.log("unmount project_log")
