From e122ae186cd25da178fe24c85644de69971e4a89 Mon Sep 17 00:00:00 2001 From: tonyfages Date: Fri, 16 Feb 2024 15:08:30 +0100 Subject: [PATCH] part4 --- JokesApp/redux/store.ts | 3 ++- JokesApp/screens/AccueilScreen.tsx | 2 ++ JokesApp/screens/ListJokeScreen.tsx | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/JokesApp/redux/store.ts b/JokesApp/redux/store.ts index 28eabdb..746f93b 100644 --- a/JokesApp/redux/store.ts +++ b/JokesApp/redux/store.ts @@ -9,7 +9,8 @@ const reducer = { // @ts-ignore const store = configureStore({ - reducer: reducer, + // @ts-ignore + reducer, middleware: (getDefaultMiddleware) => getDefaultMiddleware({ serializableCheck: false diff --git a/JokesApp/screens/AccueilScreen.tsx b/JokesApp/screens/AccueilScreen.tsx index 339e8b3..5dccc3c 100644 --- a/JokesApp/screens/AccueilScreen.tsx +++ b/JokesApp/screens/AccueilScreen.tsx @@ -21,11 +21,13 @@ export function AccueilScreen() { useEffect(() => { const getJokes = async () => { + // @ts-ignore dispatch(setRecentJokes(await getLatestJokes())); }; getJokes(); const getTopCategories = async () => { + // @ts-ignore dispatch(setCategories(await getCategorie())); }; getTopCategories(); diff --git a/JokesApp/screens/ListJokeScreen.tsx b/JokesApp/screens/ListJokeScreen.tsx index b12bbc4..c61b97c 100644 --- a/JokesApp/screens/ListJokeScreen.tsx +++ b/JokesApp/screens/ListJokeScreen.tsx @@ -13,6 +13,7 @@ export function ListJokeScreen() { const dispatch = useDispatch(); useEffect(() => { const getJokes = async () => { + // @ts-ignore dispatch(setSample(await getSampleJoke())); }; getJokes();