diff --git a/scripts/vendor-zoo-modeling-app.mjs b/scripts/vendor-zoo-modeling-app.mjs index 0ccf212a4..f2508929a 100644 --- a/scripts/vendor-zoo-modeling-app.mjs +++ b/scripts/vendor-zoo-modeling-app.mjs @@ -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() {