From 299befdb0fe2bfa52a2f245c45c7b27a219e61b1 Mon Sep 17 00:00:00 2001 From: Nicolas Van Labeke Date: Wed, 13 Sep 2023 14:27:24 +0100 Subject: [PATCH] fix(95): remove storage of client --- .../frontend/src/api/hooks/useHttpClient/useHttpClient.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hivemq-edge/src/frontend/src/api/hooks/useHttpClient/useHttpClient.ts b/hivemq-edge/src/frontend/src/api/hooks/useHttpClient/useHttpClient.ts index 28bffbf632..53b0037657 100644 --- a/hivemq-edge/src/frontend/src/api/hooks/useHttpClient/useHttpClient.ts +++ b/hivemq-edge/src/frontend/src/api/hooks/useHttpClient/useHttpClient.ts @@ -1,4 +1,3 @@ -import { useState } from 'react' import axios, { AxiosError } from 'axios' import { useNavigate } from 'react-router-dom' @@ -24,7 +23,7 @@ export class AxiosHttpRequestWithInterceptors extends BaseHttpRequest { export const useHttpClient = () => { const { credentials, logout } = useAuth() const navigate = useNavigate() - const [client] = useState(createInstance) + // const [client] = useState(createInstance) function createInstance() { // Make sure to clear the interceptors, since axiosInstance is global @@ -66,5 +65,5 @@ export const useHttpClient = () => { ) } - return client + return createInstance() }