Commit 59afd96 1 parent 2cc4a65 commit 59afd96 Copy full SHA for 59afd96
File tree 1 file changed +13
-2
lines changed
suite-common/connect-init/src
1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -127,9 +127,20 @@ export const connectInitThunk = createThunk(
127
127
if ( window . location . origin . includes ( 'localhost' ) ) {
128
128
_sessionsBackgroundUrl = null ;
129
129
} else if ( window . location . origin . endsWith ( 'dev.suite.sldev.cz' ) ) {
130
- //https:// dev.suite.sldev.cz/suite-web /fix-sharing-of-sharedworker/web/static/connect/ workers/sessions-background-sharedworker.js
130
+ //dev.suite.sldev.cz/connect /fix-sharing-of-sharedworker/workers/sessions-background-sharedwor…
131
131
// we are expecting accompanying connect build at specified location
132
- _sessionsBackgroundUrl = `${ window . location . origin } ${ process . env . ASSET_PREFIX || '' } /static/connect/workers/sessions-background-sharedworker.js` ;
132
+ const a = ( process . env . ASSET_PREFIX || '' ) . split ( '/' ) . filter ( Boolean ) ;
133
+ const b = a
134
+ . map ( ( segment , index ) => {
135
+ const first = index === 0 ;
136
+ const last = index === a . length - 1 ;
137
+ if ( segment === 'suite-web' && first ) return 'connect' ;
138
+ if ( segment === 'web' && last ) return null ;
139
+ return segment ;
140
+ } )
141
+ . filter ( Boolean ) ;
142
+
143
+ _sessionsBackgroundUrl = `${ window . location . origin } /${ b . join ( '/' ) } /workers/sessions-background-sharedworker.js` ;
133
144
} else {
134
145
_sessionsBackgroundUrl =
135
146
'https://connect.trezor.io/9/workers/sessions-background-sharedworker.js' ;
You can’t perform that action at this time.
0 commit comments