mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-03 00:47:53 +00:00
try to stop polling videos (#445)
Co-authored-by: wil <wil@storyteller.ai>
This commit is contained in:
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");
|
||||
|
||||
Reference in new issue
Block a user