From baa76d64ae1b9e8c78cf23a7706735bebb12f17f Mon Sep 17 00:00:00 2001 From: Berdyshev Oleksandr Date: Fri, 18 Mar 2022 10:15:01 +0300 Subject: [PATCH] fix(0000): fix added favorites --- src/features/UserFavorites/hooks/index.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/features/UserFavorites/hooks/index.tsx b/src/features/UserFavorites/hooks/index.tsx index 6b3b7a0a..6f2ec9d7 100644 --- a/src/features/UserFavorites/hooks/index.tsx +++ b/src/features/UserFavorites/hooks/index.tsx @@ -20,7 +20,11 @@ export const useUserFavorites = () => { } = useToggle() const fetchFavorites = useCallback(() => { - getUserFavorites().then(setUserFavorites) + getUserFavorites().then((value) => { + if (Array.isArray(value)) { + setUserFavorites(value) + } + }) }, []) const addRemoveFavorite = (args: Args) => {