fix: resolve embedded HiCAD websocket URLs
This commit is contained in:
parent
56658a4d16
commit
5f15b99e7c
@ -100,6 +100,9 @@ function replaceSource(relativePath, before, after) {
|
||||
return;
|
||||
}
|
||||
if (!source.includes(before)) {
|
||||
if (!after) {
|
||||
return;
|
||||
}
|
||||
throw new Error(`Official source changed; patch failed for ${relativePath}`);
|
||||
}
|
||||
writeFileSync(filePath, source.replace(before, after));
|
||||
@ -191,6 +194,16 @@ function patchOfficialSource() {
|
||||
" {displayedName !== user.email && (",
|
||||
" {!isHiCadEmbedded && displayedName !== user.email && ("
|
||||
);
|
||||
replaceSource(
|
||||
"src/components/environment/Environment.tsx",
|
||||
" new URL(env().VITE_KITTYCAD_WEBSOCKET_URL ?? ''),",
|
||||
" new URL(env().VITE_KITTYCAD_WEBSOCKET_URL ?? '', window.location.href),"
|
||||
);
|
||||
replaceSource(
|
||||
"src/components/environment/Environment.tsx",
|
||||
" new URL(env().VITE_MLEPHANT_WEBSOCKET_URL ?? '')",
|
||||
" new URL(env().VITE_MLEPHANT_WEBSOCKET_URL ?? '', window.location.href)"
|
||||
);
|
||||
}
|
||||
|
||||
function ensureDependencies() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user