diff --git a/package-lock.json b/package-lock.json index 2c1ac12..6dd1d10 100644 --- a/package-lock.json +++ b/package-lock.json @@ -43,7 +43,7 @@ "react-native-reanimated": "~2.12.0", "react-native-safe-area-context": "4.4.1", "react-native-screens": "~3.18.0", - "react-native-svg": "^13.7.0", + "react-native-svg": "13.4.0", "react-native-vector-icons": "^9.2.0", "react-native-video": "^2.3.1", "react-native-video-player": "^0.14.0", @@ -15057,9 +15057,9 @@ } }, "node_modules/react-native-svg": { - "version": "13.8.0", - "resolved": "https://registry.npmjs.org/react-native-svg/-/react-native-svg-13.8.0.tgz", - "integrity": "sha512-G8Mx6W86da+vFimZBJvA93POw8yz0fgDS5biy6oIjMWVJVQSDzCyzwO/zY0yuZmCDhKSZzogl5m0wXXvW2OcTA==", + "version": "13.4.0", + "resolved": "https://registry.npmjs.org/react-native-svg/-/react-native-svg-13.4.0.tgz", + "integrity": "sha512-B3TwK+H0+JuRhYPzF21AgqMt4fjhCwDZ9QUtwNstT5XcslJBXC0FoTkdZo8IEb1Sv4suSqhZwlAY6lwOv3tHag==", "dependencies": { "css-select": "^5.1.0", "css-tree": "^1.1.3" @@ -29608,9 +29608,9 @@ } }, "react-native-svg": { - "version": "13.8.0", - "resolved": "https://registry.npmjs.org/react-native-svg/-/react-native-svg-13.8.0.tgz", - "integrity": "sha512-G8Mx6W86da+vFimZBJvA93POw8yz0fgDS5biy6oIjMWVJVQSDzCyzwO/zY0yuZmCDhKSZzogl5m0wXXvW2OcTA==", + "version": "13.4.0", + "resolved": "https://registry.npmjs.org/react-native-svg/-/react-native-svg-13.4.0.tgz", + "integrity": "sha512-B3TwK+H0+JuRhYPzF21AgqMt4fjhCwDZ9QUtwNstT5XcslJBXC0FoTkdZo8IEb1Sv4suSqhZwlAY6lwOv3tHag==", "requires": { "css-select": "^5.1.0", "css-tree": "^1.1.3" diff --git a/package.json b/package.json index 5bea38f..16fb5bf 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ "react-native-reanimated": "~2.12.0", "react-native-safe-area-context": "4.4.1", "react-native-screens": "~3.18.0", - "react-native-svg": "^13.7.0", + "react-native-svg": "13.4.0", "react-native-vector-icons": "^9.2.0", "react-native-video": "^2.3.1", "react-native-video-player": "^0.14.0", diff --git a/screens/HomeScreen.tsx b/screens/HomeScreen.tsx index 44dc110..089eec5 100644 --- a/screens/HomeScreen.tsx +++ b/screens/HomeScreen.tsx @@ -11,11 +11,9 @@ import CardsSwipe from 'react-native-cards-swipe'; import AnimatedLottieView from "lottie-react-native"; import {Timer, Timer2} from "../components/TimerComponent"; import {HeaderMovie} from "../components/HeaderMovieComponent"; -import config from "../constants/config.js"; -import * as https from "https"; import {NewCard, SuggestedCard} from "../components/cards"; import {setFavouriteList,setWatchLaterList} from "../storage/storageFavourite" -import AsyncStorage from "@react-native-async-storage/async-storage"; + export default function HomeScreen({navigation}: RootStackScreenProps<'Home'>) { // @ts-ignore @@ -187,14 +185,14 @@ export default function HomeScreen({navigation}: RootStackScreenProps<'Home'>) { } function addWatchLater(props: Movie) { - + const newwatchLaterMovies = [props, ...watchLaterMovies] if(watchLaterMovies.filter((movie : Movie) => movie.original_title === props.original_title).length > 0){ return null } else{ - setWatchLaterList(watchLaterMovies); dispatch(addMovieToWatchLater(props)); dispatch(removeMovieTrending(props)); + setWatchLaterList(newwatchLaterMovies); console.log("movie: ", props.id, props.full_date, new Date(props.full_date).getTime()), new Date(trendingMovies[displayIndex].full_date).getTime(); if (displayIndex == trendingMovies.length - 1) { setdisplayIndex(0); @@ -205,13 +203,16 @@ export default function HomeScreen({navigation}: RootStackScreenProps<'Home'>) { } function addFavourite(props: Movie) { + const newFavouriteMovies = [props, ...favouriteMovies] if(favouriteMovies.filter((movie : Movie) => movie.original_title === props.original_title).length > 0){ return null } else{ - setFavouriteList(favouriteMovies); + dispatch(addMovieToFavourite(props)); dispatch(removeMovieTrending(props)); + console.log(favouriteMovies) + setFavouriteList(newFavouriteMovies); console.log("movie: ", props.id, props.full_date, new Date(props.full_date).getTime()), new Date(trendingMovies[displayIndex].full_date).getTime(); if (displayIndex == trendingMovies.length - 1) { setdisplayIndex(0);