File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
src/app/components/sandbox/Preview Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ type State = {
5757
5858export default class Preview extends React . PureComponent < Props , State > {
5959 initialPath : string ;
60- frames : Set < HTMLIFrameElement > ;
60+ frames : Array < HTMLIFrameElement > ;
6161
6262 constructor ( props : Props ) {
6363 super ( props ) ;
@@ -78,7 +78,7 @@ export default class Preview extends React.PureComponent<Props, State> {
7878 // from the query params, or the iframe will continue to be re-rendered
7979 // when the user navigates the iframe app, which shows the loading screen
8080 this . initialPath = props . initialPath ;
81- this . frames = new Set ( ) ;
81+ this . frames = [ ] ;
8282 }
8383
8484 static defaultProps = {
@@ -169,14 +169,16 @@ export default class Preview extends React.PureComponent<Props, State> {
169169 } ;
170170
171171 sendMessage = ( message : Object ) => {
172- Array . from ( this . frames ) . forEach ( frame => {
172+ this . frames . forEach ( frame => {
173173 frame . postMessage ( message , frameUrl ( this . props . sandboxId ) ) ;
174174 } ) ;
175175 } ;
176176
177177 handleMessage = ( e : MessageEvent | { data : Object | string } ) => {
178178 if ( e . data === 'Ready!' ) {
179- this . frames . add ( e . source ) ;
179+ if ( this . frames . indexOf ( e . source ) === - 1 ) {
180+ this . frames . push ( e . source ) ;
181+ }
180182
181183 this . setState ( {
182184 frameInitialized : true ,
You can’t perform that action at this time.
0 commit comments