From 41eb11bbcc56f606c8c7b7bfd71e5ec0ec0be3c0 Mon Sep 17 00:00:00 2001 From: Sam Date: Sat, 4 Mar 2023 19:50:44 +0100 Subject: [PATCH] Client - fix error message when api is not running --- fittrackee_client/src/api/authApi.ts | 2 +- fittrackee_client/src/api/defaultApi.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fittrackee_client/src/api/authApi.ts b/fittrackee_client/src/api/authApi.ts index 6ea4ca5e..c4f1a487 100644 --- a/fittrackee_client/src/api/authApi.ts +++ b/fittrackee_client/src/api/authApi.ts @@ -34,7 +34,7 @@ authApi.interceptors.response.use( return response }, (error) => { - if (error.message !== 'canceled') { + if (error.message !== 'canceled' && error.response) { removeRequestIfPending(error.response.config) } return Promise.reject(error) diff --git a/fittrackee_client/src/api/defaultApi.ts b/fittrackee_client/src/api/defaultApi.ts index 791658dc..4efb5ebc 100644 --- a/fittrackee_client/src/api/defaultApi.ts +++ b/fittrackee_client/src/api/defaultApi.ts @@ -24,7 +24,7 @@ api.interceptors.response.use( return response }, (error) => { - if (error.message !== 'canceled') { + if (error.message !== 'canceled' && error.response) { removeRequestIfPending(error.response.config) } return Promise.reject(error)