Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix(homepage): Second picked sandbox doesn't open in explore #1715

Merged
merged 1 commit into from
Apr 4, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix(homepage): Second picked sandbox doesnt open in explore
  • Loading branch information
tinahir committed Apr 4, 2019
commit c524639f6641580595bca0cec033fad75c43b912
13 changes: 6 additions & 7 deletions packages/homepage/src/screens/explore/SandboxModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export default class SandboxModal extends React.PureComponent {
};
loadedSandboxes = {};

getSandbox = (sandboxId: string) => {
getSandbox = sandboxId => {
track('Explore Sandbox Open', { sandboxId });

if (this.loadedSandboxes[sandboxId]) {
Expand Down Expand Up @@ -71,7 +71,7 @@ export default class SandboxModal extends React.PureComponent {

const sandbox = await this.getSandbox(props.sandboxId);

this.setState({ sandbox });
this.setState({ sandbox, showFrame: true });

if (this.frame) {
await this.frameInitializedPromise;
Expand All @@ -86,10 +86,6 @@ export default class SandboxModal extends React.PureComponent {
this.frameInitializedPromise = new Promise(resolve => {
this.resolveFrameInitializedPromise = resolve;
});

setTimeout(() => {
this.setState({ showFrame: true });
}, 1000);
}

componentWillUnmount() {
Expand Down Expand Up @@ -118,7 +114,10 @@ export default class SandboxModal extends React.PureComponent {

componentWillReceiveProps(nextProps) {
if (nextProps.sandboxId !== this.props.sandboxId) {
this.setState({ sandbox: undefined });
this.setState({
sandbox: undefined,
showFrame: false,
});
this.fetchSandbox(nextProps);
}
}
Expand Down