chore: urls are using the global websocket url

This commit is contained in:
Kevin
2025-07-02 16:48:41 -05:00
parent b97bcdefa8
commit e7559c19e4
3 changed files with 17 additions and 5 deletions

View File

@ -388,7 +388,9 @@ class EngineConnection extends EventTarget {
// SHOULD ONLY BE USED FOR VITESTS // SHOULD ONLY BE USED FOR VITESTS
connectLite(callback: () => void) { connectLite(callback: () => void) {
const url = withWebSocketURL(`?video_res_width=${256}&video_res_height=${256}`) const url = withWebSocketURL(
`?video_res_width=${256}&video_res_height=${256}`
)
this.websocket = new WebSocket(url, []) this.websocket = new WebSocket(url, [])
this.websocket.binaryType = 'arraybuffer' this.websocket.binaryType = 'arraybuffer'
@ -1531,7 +1533,9 @@ export class EngineCommandManager extends EventTarget {
additionalSettings += additionalSettings +=
'&show_grid=' + (this.settings.showScaleGrid ? 'true' : 'false') '&show_grid=' + (this.settings.showScaleGrid ? 'true' : 'false')
const pool = !this.settings.pool ? '' : `&pool=${this.settings.pool}` const pool = !this.settings.pool ? '' : `&pool=${this.settings.pool}`
const url = withWebSocketURL(`?video_res_width=${width}&video_res_height=${height}${additionalSettings}${pool}`) const url = withWebSocketURL(
`?video_res_width=${width}&video_res_height=${height}${additionalSettings}${pool}`
)
this.engineConnection = new EngineConnection({ this.engineConnection = new EngineConnection({
engineCommandManager: this, engineCommandManager: this,
url, url,

View File

@ -1,4 +1,8 @@
import { withAPIBaseURL, withSiteBaseURL, withWebSocketURL } from '@src/lib/withBaseURL' import {
withAPIBaseURL,
withSiteBaseURL,
withWebSocketURL,
} from '@src/lib/withBaseURL'
describe('withBaseURL', () => { describe('withBaseURL', () => {
/** /**

View File

@ -1,4 +1,8 @@
import { VITE_KC_API_BASE_URL, VITE_KC_SITE_BASE_URL, VITE_KC_API_WS_MODELING_URL } from '@src/env' import {
VITE_KC_API_BASE_URL,
VITE_KC_SITE_BASE_URL,
VITE_KC_API_WS_MODELING_URL,
} from '@src/env'
export function withAPIBaseURL(path: string): string { export function withAPIBaseURL(path: string): string {
return VITE_KC_API_BASE_URL + path return VITE_KC_API_BASE_URL + path
@ -8,6 +12,6 @@ export function withSiteBaseURL(path: string): string {
return VITE_KC_SITE_BASE_URL + path return VITE_KC_SITE_BASE_URL + path
} }
export function withWebSocketURL(path: string) : string { export function withWebSocketURL(path: string): string {
return VITE_KC_API_WS_MODELING_URL + path return VITE_KC_API_WS_MODELING_URL + path
} }