tagshow: correctly union matching photos

This commit is contained in:
Aaron Boodman
2015-08-25 15:10:21 -07:00
parent cd11714444
commit 10f4fd4fdd

View File

@@ -30,11 +30,14 @@ var SlideShow = React.createClass({
render: function() {
this.props.ds
.then(head => head.get('value').deref())
.then(tags => Promise.all(
.then(tags => {
return Promise.all(
tags.filter((v, t) => this.props.tags.has(t))
.valueSeq()
.map(ref => ref.deref())))
.then(sets => this.setState({photos: Immutable.Set(...sets)}));
.map(ref => ref.deref()))
}).then(sets => {
this.setState({photos: Immutable.Set().union(...sets)})
});
return <div style={containerStyle}>{
this.state.photos