try to stop polling videos (#445)

Co-authored-by: wil <wil@storyteller.ai>
This commit is contained in:
wilandwil authored and GitHub committed 2024-05-30 17:44:36 -04:00
1 parent b3b30fdf49
commit d0eb92984f
2 files changed
+5 -1

No files matched your search

@@ -12,6 +12,7 @@ export const useBackgroundLoadingMedia = () => {
//CASE 1: first load
// if myMovies undefined, poll for the first time
if (!userMovies.value) {
userMovies.value = [];
PollUserMovies();
return;
}
@@ -12,6 +12,7 @@ import {
authentication,
setUserAudioItems,
setUserMovies,
userMovies,
} from "~/signals";
const { userInfo } = authentication;
@@ -28,7 +29,9 @@ export function PollUserMovies() {
},
)
.then((res: GetMediaListResponse) => {
setUserMovies(res.results);
if (userMovies.value && res.results.length !== userMovies.value.length) {
setUserMovies(res.results);
}
})
.catch(() => {
addToast(ToastTypes.ERROR, "Unknown Error in Loading My Movies");