Skip to content

Commit f17c61b

Browse files
committed
fix: return platform to cards container
1 parent 8b13d10 commit f17c61b

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

packages/scratch-gui/src/containers/cards.jsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,21 @@ class Cards extends React.Component {
3333
}
3434
}
3535
render () {
36+
const props = {
37+
...this.props,
38+
// Assume user is offline and don't attempt to
39+
// download and show videos
40+
showVideos: this.props.platform !== PLATFORM.DESKTOP
41+
};
3642
return (
37-
<CardsComponent {...this.props} />
43+
<CardsComponent {...props} />
3844
);
3945
}
4046
}
4147

4248
Cards.propTypes = {
4349
locale: PropTypes.string.isRequired,
50+
platform: PropTypes.oneOf(Object.keys(PLATFORM))
4451
};
4552

4653
const mapStateToProps = state => ({
@@ -54,9 +61,7 @@ const mapStateToProps = state => ({
5461
isRtl: state.locales.isRtl,
5562
locale: state.locales.locale,
5663
dragging: state.scratchGui.cards.dragging,
57-
// Assume user is offline and don't attempt to
58-
// download and show videos
59-
showVideos: state.scratchGui.platform.platform !== PLATFORM.DESKTOP
64+
platform: state.scratchGui.platform.platform
6065
});
6166

6267
const mapDispatchToProps = dispatch => ({

0 commit comments

Comments
 (0)