diff --git a/src/App.tsx b/src/App.tsx index 3f5541a..ee638f9 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -127,7 +127,6 @@ export class App extends React.Component { */ export async function fetchConfiguration(): Promise { const url = `${import.meta.env.VITE_API_URL}`; - // The test library cannot use the Fetch API // @ts-ignore if (window.fetch) { @@ -138,15 +137,13 @@ export async function fetchConfiguration(): Promise { response.json() ) as Configuration; } - - return new Promise((resolve, reject) => { + return new Promise((resolve) => { const xhr = new XMLHttpRequest(); xhr.open('POST', url, true); xhr.onreadystatechange = function() { // Call a function when the state changes. if (xhr.readyState === XMLHttpRequest.DONE && xhr.status === 200) { resolve(JSON.parse(this.responseText)); } - reject(xhr.responseText); }; xhr.send(); });