File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed
Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,8 @@ const INTERNAL_PATHS = {
1616 run : 'https://codeit.codes/run' ,
1717 run_ : 'https://dev.codeit.codes/run' ,
1818
19+ relLivePath : '/run/' + '_/' . repeat ( 15 ) ;
20+
1921 clientId: 'https://codeit.codes/worker/getClientId' ,
2022 clientId_ : 'https://dev.codeit.codes/worker/getClientId' ,
2123
@@ -198,16 +200,22 @@ function handleFetchRequest(request, event) {
198200 }
199201
200202
201- const clientId = event . clientId ;
203+ let clientId = event . clientId ;
204+
205+ const [ url , parentClientId ] = request . url . split ( '?' ) ;
206+
207+ const liveFramePath = INTERNAL_PATHS . relLivePath ;
202208
203209 // if codeit client is creating a new live view
204- if ( clientId && event . resultingClientId ) {
210+ if ( url . endsWith ( liveFramePath )
211+ && event . resultingClientId ) {
205212
206213 // add live view to client array
207-
208- const parentClientId = clientId ;
214+
209215 const liveViewClientId = event . resultingClientId ;
210216
217+ clientId = parentClientId ;
218+
211219 // pair live view client ID
212220 // with codeit client ID
213221 // in client array
You can’t perform that action at this time.
0 commit comments