From d66e6133380d01de4c15901bd5ffa721f9c2c2ad Mon Sep 17 00:00:00 2001 From: suryabulusu Date: Tue, 15 Aug 2023 13:57:50 +0530 Subject: [PATCH] removes delay --- src/services/API/RootClient.ts | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) 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 => {