Browse Source

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

master
Gisle Aune 6 years ago
parent
commit
2d89096430
  1. 5
      marko/page/logs-content/components/page/component.js

5
marko/page/logs-content/components/page/component.js

@ -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)
}

Loading…
Cancel
Save