Fix worker not using the correct url

This commit is contained in:
Eric NGUYEN 2022-11-07 10:20:15 +01:00
parent 80b83dcec7
commit 704ae2e2d2

View file

@ -16,7 +16,7 @@ export function UseWorker(
// use webworker for the stringify to avoid freezing // use webworker for the stringify to avoid freezing
myWorker.postMessage({ myWorker.postMessage({
state, state,
url: import.meta.env.VITE_API_GET_FEEDBACK_URL url: configurationUrl ?? import.meta.env.VITE_API_GET_FEEDBACK_URL
}); });
return () => { return () => {
@ -39,7 +39,8 @@ export function UseAsync(
ApplicationState: state ApplicationState: state
}; };
const dataParsed = JSON.stringify(request, GetCircularReplacer()); const dataParsed = JSON.stringify(request, GetCircularReplacer());
fetch(import.meta.env.VITE_API_GET_FEEDBACK_URL, { const url = configurationUrl ?? import.meta.env.VITE_API_GET_FEEDBACK_URL;
fetch(url, {
method: 'POST', method: 'POST',
headers: new Headers({ headers: new Headers({
// eslint-disable-next-line @typescript-eslint/naming-convention // eslint-disable-next-line @typescript-eslint/naming-convention