diff --git a/screens/MovieFinderScreenList.tsx b/screens/MovieFinderScreenList.tsx index c7398db..725c9dd 100644 --- a/screens/MovieFinderScreenList.tsx +++ b/screens/MovieFinderScreenList.tsx @@ -48,7 +48,7 @@ export default function MovieFinderScreenList(props : Props){ - Watch Later + {props.page=="Favorite"?Favourite:Watch Later} {props.children} diff --git a/storage/storage.ts b/storage/storage.ts index 03e4900..f13a3dc 100644 --- a/storage/storage.ts +++ b/storage/storage.ts @@ -5,9 +5,9 @@ export const getFavouriteList = async () => { try { const value = await AsyncStorage.getItem('favourite'); if (value === null) { - return null + return [] } - const favouriteList: Movie[] = await JSON.parse(value!) + const favouriteList: Movie[] = await JSON.parse(value) return favouriteList } catch (error) { console.log(error) @@ -27,9 +27,9 @@ export const getWatchLaterList = async () => { try { const value = await AsyncStorage.getItem('watchLater') if (value === null) { - return null + return [] } - const watchLaterList: Movie[] = await JSON.parse(value!) + const watchLaterList: Movie[] = await JSON.parse(value) return watchLaterList } catch (error) { console.log(error) @@ -49,9 +49,9 @@ export const getMovieList = async () => { try { const value = await AsyncStorage.getItem('movie') if (value === null) { - return null + return [] } - const movieList: Movie[] = await JSON.parse(value!) + const movieList: Movie[] = await JSON.parse(value) return movieList } catch (error) { console.log(error)