Showing
1 changed file
with
1 additions
and
1 deletions
| @@ -36,7 +36,7 @@ const fetchMovies = async (page: number) => { | @@ -36,7 +36,7 @@ const fetchMovies = async (page: number) => { | ||
| 36 | isLoadingMore.value = true; | 36 | isLoadingMore.value = true; |
| 37 | const data = await fetchPopularMovies(page); | 37 | const data = await fetchPopularMovies(page); |
| 38 | // Save in Movie model. | 38 | // Save in Movie model. |
| 39 | - useRepo(Movie).save(data.results); | 39 | + isInitialLoading.value ? useRepo(Movie).fresh(data.results) : useRepo(Movie).save(data.results); |
| 40 | 40 | ||
| 41 | totalPages.value = data.total_pages; | 41 | totalPages.value = data.total_pages; |
| 42 | currentPage.value = page; | 42 | currentPage.value = page; |
-
Please register or login to post a comment