From bee02e01abc09e80083d45b9986bae372487e1f8 Mon Sep 17 00:00:00 2001 From: Liang Tang <1074461480@qq.com> Date: Wed, 1 Aug 2018 01:07:19 +0800 Subject: [PATCH] bug fixes (#666) --- client/modules/IDE/components/PreviewFrame.jsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/client/modules/IDE/components/PreviewFrame.jsx b/client/modules/IDE/components/PreviewFrame.jsx index 507bdfb7..eb23b94e 100644 --- a/client/modules/IDE/components/PreviewFrame.jsx +++ b/client/modules/IDE/components/PreviewFrame.jsx @@ -31,6 +31,12 @@ class PreviewFrame extends React.Component { } 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 (this.props.isPlaying && this.props.previewIsRefreshing) { this.renderSketch();