File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -66,6 +66,15 @@ const createIframe = () => {
66
66
67
67
const iframeId = `sb__open-sandbox${ Math . floor ( Math . random ( ) * 100 ) } ` ;
68
68
iframe . setAttribute ( 'id' , iframeId ) ;
69
+
70
+ clearInterval ( interval ) ;
71
+ interval = setInterval ( ( ) => {
72
+ // Check every second whether the button is still there
73
+ if ( ! document . getElementById ( iframeId ) ) {
74
+ createIframe ( ) ;
75
+ }
76
+ } , 1000 ) ;
77
+
69
78
const link = document . createElement ( 'a' ) ;
70
79
setIframeStyle ( iframe ) ;
71
80
@@ -94,14 +103,6 @@ const createIframe = () => {
94
103
childList : true ,
95
104
subtree : true ,
96
105
} ) ;
97
-
98
- clearInterval ( interval ) ;
99
- interval = setInterval ( ( ) => {
100
- // Check every second whether the button is still there
101
- if ( ! document . getElementById ( iframeId ) ) {
102
- createIframe ( ) ;
103
- }
104
- } , 1000 ) ;
105
106
} ;
106
107
107
108
document . body . appendChild ( iframe ) ;
You can’t perform that action at this time.
0 commit comments