From 23ffa38601242d140569d5612f156da7bc8d03fc Mon Sep 17 00:00:00 2001 From: Enrico Fasoli Date: Sun, 15 Nov 2015 21:35:13 +0100 Subject: [PATCH] refactored a little function --- webapp/app.jsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/webapp/app.jsx b/webapp/app.jsx index 81dec6a..f0c6a61 100644 --- a/webapp/app.jsx +++ b/webapp/app.jsx @@ -93,9 +93,7 @@ var PostList = React.createClass({ console.log('Initial POSTS',this.state.posts.length) boards.getPostsInBoard(this.props.admin,this.props.board).on('post',(post,hash) => { if(!this.isMounted()) return true - var posts = this.state.posts - posts.push(post) - this.setState({ posts }) + this.setState({ posts: this.state.posts.concat(post) }) }) }, render: function(){