ui: fix api client pathing for spot, integrations
This commit is contained in:
parent
c7523a1526
commit
4ba16bada1
2 changed files with 8 additions and 3 deletions
|
|
@ -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.');
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue