Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
mroz22 committed Nov 4, 2024
1 parent 2cc4a65 commit 59afd96
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions suite-common/connect-init/src/connectInitThunks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,20 @@ export const connectInitThunk = createThunk(
if (window.location.origin.includes('localhost')) {
_sessionsBackgroundUrl = null;
} else if (window.location.origin.endsWith('dev.suite.sldev.cz')) {
//https://dev.suite.sldev.cz/suite-web/fix-sharing-of-sharedworker/web/static/connect/workers/sessions-background-sharedworker.js
//dev.suite.sldev.cz/connect/fix-sharing-of-sharedworker/workers/sessions-background-sharedwor…
// we are expecting accompanying connect build at specified location
_sessionsBackgroundUrl = `${window.location.origin}${process.env.ASSET_PREFIX || ''}/static/connect/workers/sessions-background-sharedworker.js`;
const a = (process.env.ASSET_PREFIX || '').split('/').filter(Boolean);
const b = a
.map((segment, index) => {
const first = index === 0;
const last = index === a.length - 1;
if (segment === 'suite-web' && first) return 'connect';
if (segment === 'web' && last) return null;
return segment;

Check failure on line 139 in suite-common/connect-init/src/connectInitThunks.ts

View workflow job for this annotation

GitHub Actions / Linting and formatting

Expected blank line before this statement
})
.filter(Boolean);

_sessionsBackgroundUrl = `${window.location.origin}/${b.join('/')}/workers/sessions-background-sharedworker.js`;
} else {
_sessionsBackgroundUrl =
'https://connect.trezor.io/9/workers/sessions-background-sharedworker.js';
Expand Down

0 comments on commit 59afd96

Please sign in to comment.