@@ -5,7 +5,6 @@ import { Prompt } from 'react-router-dom';
55import { reaction } from 'mobx' ;
66import { TextOperation } from 'ot' ;
77import { inject , observer } from 'mobx-react' ;
8- import { debounce } from 'lodash-es' ;
98
109import getTemplateDefinition from 'common/lib/templates' ;
1110import type { ModuleError } from 'common/lib/types' ;
@@ -64,8 +63,6 @@ class EditorPreview extends React.Component<Props, State> {
6463 ( ) => this . forceUpdate ( )
6564 ) ;
6665
67- this . getBounds = debounce ( this . getBoundsInstantly , 100 ) ;
68-
6966 window . addEventListener ( 'resize' , this . getBounds ) ;
7067
7168 this . interval = setInterval ( ( ) => {
@@ -87,7 +84,7 @@ class EditorPreview extends React.Component<Props, State> {
8784 }
8885 }
8986
90- getBoundsInstantly = el => {
87+ getBounds = el => {
9188 if ( el ) {
9289 this . el = this . el || el ;
9390 }
@@ -331,7 +328,7 @@ class EditorPreview extends React.Component<Props, State> {
331328 ( ) => this . props . store . editor . previewWindowVisible ,
332329 ( ) => {
333330 requestAnimationFrame ( ( ) => {
334- this . getBoundsInstantly ( ) ;
331+ this . getBounds ( ) ;
335332 } ) ;
336333 }
337334 ) ;
@@ -552,7 +549,7 @@ class EditorPreview extends React.Component<Props, State> {
552549 } }
553550 >
554551 < div
555- ref = { this . getBoundsInstantly }
552+ ref = { this . getBounds }
556553 style = { {
557554 position : 'relative' ,
558555 display : 'flex' ,
0 commit comments