File tree Expand file tree Collapse file tree 1 file changed +18
-14
lines changed
packages/app/src/app/components/Preview Expand file tree Collapse file tree 1 file changed +18
-14
lines changed Original file line number Diff line number Diff line change @@ -242,28 +242,32 @@ class BasePreview extends React.Component<Props, State> {
242242 sendUrl = ( ) => {
243243 const { urlInAddressBar } = this . state ;
244244
245- // $FlowIssue
246- document . getElementById ( 'sandbox' ) . src = urlInAddressBar ;
245+ if ( document . getElementById ( 'sandbox' ) ) {
246+ // $FlowIssue
247+ document . getElementById ( 'sandbox' ) . src = urlInAddressBar ;
247248
248- this . setState ( {
249- history : [ urlInAddressBar ] ,
250- historyPosition : 0 ,
251- urlInAddressBar,
252- } ) ;
249+ this . setState ( {
250+ history : [ urlInAddressBar ] ,
251+ historyPosition : 0 ,
252+ urlInAddressBar,
253+ } ) ;
254+ }
253255 } ;
254256
255257 handleRefresh = ( ) => {
256258 const { history, historyPosition, urlInAddressBar } = this . state ;
257259 const url = history [ historyPosition ] || urlInAddressBar ;
258260
259- // $FlowIssue
260- document . getElementById ( 'sandbox' ) . src = url ;
261+ if ( document . getElementById ( 'sandbox' ) ) {
262+ // $FlowIssue
263+ document . getElementById ( 'sandbox' ) . src = url ;
261264
262- this . setState ( {
263- history : [ url ] ,
264- historyPosition : 0 ,
265- urlInAddressBar : url ,
266- } ) ;
265+ this . setState ( {
266+ history : [ url ] ,
267+ historyPosition : 0 ,
268+ urlInAddressBar : url ,
269+ } ) ;
270+ }
267271 } ;
268272
269273 handleBack = ( ) => {
You can’t perform that action at this time.
0 commit comments