diff --git a/src/services/API/RootClient.ts b/src/services/API/RootClient.ts index 1b20db4..bb911c0 100644 --- a/src/services/API/RootClient.ts +++ b/src/services/API/RootClient.ts @@ -5,22 +5,11 @@ import ErrorHandling from "./ErrorHandling"; const client = axios.create({ baseURL: process.env.VUE_APP_BACKEND, withCredentials: false, - timeout: 4000, // cancel request after 10 sec + timeout: 4000, // cancel request after 4 sec // but this works only when internet connection is active // ref: https://stackoverflow.com/questions/36690451/timeout-feature-in-the-axios-library-is-not-working }); -// delay response by one second to notice loading spinner -client.interceptors.response.use(function (response) { - return new Promise((resolve) => { - setTimeout(() => { - resolve(response); - }, 1000); - }); -}, function (error) { - return Promise.reject(error); -}); - // handle errors in responses for API requests client.interceptors.response.use( (config: AxiosRequestConfig): AxiosRequestConfig => {