File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed
packages/homepage/src/screens/explore Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ export default class SandboxModal extends React.PureComponent {
4343 } ;
4444 loadedSandboxes = { } ;
4545
46- getSandbox = ( sandboxId : string ) => {
46+ getSandbox = sandboxId => {
4747 track ( 'Explore Sandbox Open' , { sandboxId } ) ;
4848
4949 if ( this . loadedSandboxes [ sandboxId ] ) {
@@ -71,7 +71,7 @@ export default class SandboxModal extends React.PureComponent {
7171
7272 const sandbox = await this . getSandbox ( props . sandboxId ) ;
7373
74- this . setState ( { sandbox } ) ;
74+ this . setState ( { sandbox, showFrame : true } ) ;
7575
7676 if ( this . frame ) {
7777 await this . frameInitializedPromise ;
@@ -86,10 +86,6 @@ export default class SandboxModal extends React.PureComponent {
8686 this . frameInitializedPromise = new Promise ( resolve => {
8787 this . resolveFrameInitializedPromise = resolve ;
8888 } ) ;
89-
90- setTimeout ( ( ) => {
91- this . setState ( { showFrame : true } ) ;
92- } , 1000 ) ;
9389 }
9490
9591 componentWillUnmount ( ) {
@@ -118,7 +114,10 @@ export default class SandboxModal extends React.PureComponent {
118114
119115 componentWillReceiveProps ( nextProps ) {
120116 if ( nextProps . sandboxId !== this . props . sandboxId ) {
121- this . setState ( { sandbox : undefined } ) ;
117+ this . setState ( {
118+ sandbox : undefined ,
119+ showFrame : false ,
120+ } ) ;
122121 this . fetchSandbox ( nextProps ) ;
123122 }
124123 }
You can’t perform that action at this time.
0 commit comments