logs-content: Fixed post being added twice on add due to race condition between websocket and mutation return.

This commit is contained in:
2019-04-25 20:53:59 +02:00
parent 5c4446f161
commit 2d89096430
@@ -111,6 +111,11 @@ module.exports = class {
}
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 = Object.assign({}, this.state.log)
}