Skip to content

Commit 1870896

Browse files
author
Ives van Hoorne
committed
Don't execute code when user is only navigating
1 parent 80e17c4 commit 1870896

File tree

1 file changed

+5
-0
lines changed
  • src/app/pages/SandboxView/Editor/Content/View/subviews/Preview

1 file changed

+5
-0
lines changed

src/app/pages/SandboxView/Editor/Content/View/subviews/Preview/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,11 @@ export default class Preview extends React.PureComponent {
8181
};
8282

8383
componentDidUpdate(prevProps: Props) {
84+
if (prevProps.module.id !== this.props.module.id && this.state.isProjectView) {
85+
// If user only navigated while watching project
86+
return;
87+
}
88+
8489
if ((prevProps.module.code !== this.props.module.code) && this.state.frameInitialized) {
8590
this.executeCode();
8691
}

0 commit comments

Comments
 (0)