tagshow: sort photos deterministically

This commit is contained in:
Aaron Boodman
2015-08-18 09:46:43 -07:00
parent c942f11b6a
commit fe40fe7996

View File

@@ -19,9 +19,16 @@ var SlideShow = React.createClass({
render: function() {
return <div>{
this.props.photos.map(
photoRef => <Item key={photoRef.ref} photoRef={photoRef}/>
).toArray()
this.props.photos
.sort(
// This sorts the photos deterministically, by the ref of their image
// blob.
// TODO: Sort by create date if it ends up that the common image type
// has a create date.
(a, b) => a.ref < b.ref)
.map(
photoRef => <Item key={photoRef.ref} photoRef={photoRef}/>)
.toArray()
}</div>
},
});