From 4ba16bada1354f7a05a0a7fb77d6606ae5968579 Mon Sep 17 00:00:00 2001 From: nick-delirium Date: Mon, 10 Feb 2025 11:35:33 +0100 Subject: [PATCH] ui: fix api client pathing for spot, integrations --- frontend/app/api_client.ts | 5 +++++ .../Spots/SpotPlayer/components/SpotVideoContainer.tsx | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/frontend/app/api_client.ts b/frontend/app/api_client.ts index 2ff35c561..cf59aa2d1 100644 --- a/frontend/app/api_client.ts +++ b/frontend/app/api_client.ts @@ -167,7 +167,11 @@ export default class APIClient { delete init.body; } + const noChalice = path.includes('v1/integrations') || path.includes('/spot') && !path.includes('/login') let edp = window.env.API_EDP || window.location.origin + '/api'; + if (noChalice && !edp.includes('api.openreplay.com')) { + edp = edp.replace('/api', '') + } if ( path !== '/targets_temp' && !path.includes('/metadata/session_search') && @@ -181,6 +185,7 @@ export default class APIClient { } const fullUrl = edp + _path; + console.log(path, edp, _path, fullUrl) const response = await window.fetch(fullUrl, init); if (response.status === 403) { console.warn('API returned 403. Clearing JWT token.'); diff --git a/frontend/app/components/Spots/SpotPlayer/components/SpotVideoContainer.tsx b/frontend/app/components/Spots/SpotPlayer/components/SpotVideoContainer.tsx index 0fe7a81ea..87165789d 100644 --- a/frontend/app/components/Spots/SpotPlayer/components/SpotVideoContainer.tsx +++ b/frontend/app/components/Spots/SpotPlayer/components/SpotVideoContainer.tsx @@ -77,10 +77,10 @@ function SpotVideoContainer({ setProcessingState(ProcessingState.Ready); } import('hls.js').then(({ default: Hls }) => { + const isSafari = /^((?!chrome|android).)*safari/i.test( + navigator.userAgent + ); if (Hls.isSupported() && videoRef.current) { - const isSafari = /^((?!chrome|android).)*safari/i.test( - navigator.userAgent - ); if (isSafari) { setLoaded(true); } else {