Remove extra scene in floating header if it hasn't been evicted due to transition yet

This commit is contained in:
Brent Vatne
2018-02-08 12:32:09 -08:00
parent 5641b42975
commit ac741a703b

View File

@@ -262,7 +262,11 @@ class Header extends React.PureComponent {
let appBar;
if (this.props.mode === 'float') {
const scenesProps = this.props.scenes.map(scene => ({
const scenesByIndex = {};
this.props.scenes.forEach(scene => {
scenesByIndex[scene.index] = scene;
});
const scenesProps = Object.values(scenesByIndex).map(scene => ({
position: this.props.position,
progress: this.props.progress,
scene,