|
@ -111,6 +111,11 @@ module.exports = class { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
postAdded(post) { |
|
|
postAdded(post) { |
|
|
|
|
|
// Stop duplicates in case of race condition.
|
|
|
|
|
|
if (this.state.log.posts.find(p => p.id === post.id)) { |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
this.state.log.posts = this.state.log.posts.concat([post]) |
|
|
this.state.log.posts = this.state.log.posts.concat([post]) |
|
|
this.state.log = Object.assign({}, this.state.log) |
|
|
this.state.log = Object.assign({}, this.state.log) |
|
|
} |
|
|
} |
|
|