From 39a7e109c8dc4097432a92386dba7621472c5a83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciek=20G=C5=82owacki?= Date: Mon, 14 Dec 2020 17:20:44 +0100 Subject: [PATCH] increased delay --- src/components/App.tsx | 2 +- src/contexts/CoursesProvider.tsx | 2 +- src/utils/axiosInstance.ts | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/App.tsx b/src/components/App.tsx index 69c53e0..37ca50b 100644 --- a/src/components/App.tsx +++ b/src/components/App.tsx @@ -21,7 +21,7 @@ export const App = () => { const { isDataLoading } = useContext(coursesContext)!; const [isOpenTransfer, setOpenTransfer] = useState(false); - const handleTransfer = () => { + const handleTransfer = () => { setOpenTransfer(!isOpenTransfer); }; diff --git a/src/contexts/CoursesProvider.tsx b/src/contexts/CoursesProvider.tsx index 52b9f22..16a8fd5 100644 --- a/src/contexts/CoursesProvider.tsx +++ b/src/contexts/CoursesProvider.tsx @@ -213,7 +213,7 @@ export const CoursesProvider = ({ children }: CoursesProviderProps) => { fetchCourses(); getNewestTimetable(); setIsDataLoading(false); - }, 500); + }, 600); }, []); return ( diff --git a/src/utils/axiosInstance.ts b/src/utils/axiosInstance.ts index 3996748..7761a37 100644 --- a/src/utils/axiosInstance.ts +++ b/src/utils/axiosInstance.ts @@ -5,6 +5,7 @@ export const axiosInstance = axios.create(); axiosInstance.interceptors.request.use( (config) => { const token = localStorage.getItem('userToken'); + config.headers['Content-Type'] = 'application/json'; config.headers['Authorization'] = token ? `Bearer ${token}` : ''; return config;