bug fixes (#666)

This commit is contained in:
Liang Tang 2018-08-01 01:07:19 +08:00 committed by Cassie Tarakajian
parent 617f00653c
commit bee02e01ab

View file

@ -31,6 +31,12 @@ class PreviewFrame extends React.Component {
} }
componentDidUpdate(prevProps) { componentDidUpdate(prevProps) {
// if sketch starts or stops playing, want to rerender
if (this.props.isPlaying !== prevProps.isPlaying) {
this.renderSketch();
return;
}
// if the user explicitly clicks on the play button // if the user explicitly clicks on the play button
if (this.props.isPlaying && this.props.previewIsRefreshing) { if (this.props.isPlaying && this.props.previewIsRefreshing) {
this.renderSketch(); this.renderSketch();