improved loading for change individual anime from search
This commit is contained in:
@ -11,21 +11,24 @@
|
||||
watchListPage.subscribe(value => page = value)
|
||||
animePerPage.subscribe(value => perPage = value)
|
||||
|
||||
export const CheckIfAniListLoggedInAndLoadWatchList = async () => {
|
||||
await CheckIfAniListLoggedIn().then(loggedIn => {
|
||||
if (loggedIn) {
|
||||
GetAniListLoggedInUser().then(user => {
|
||||
aniListUser.set(user)
|
||||
if (isAniListPrimary) {
|
||||
GetAniListUserWatchingList(page, perPage, MediaListSort.UpdatedTimeDesc).then((watchList) => {
|
||||
aniListWatchlist.set(watchList)
|
||||
aniListLoggedIn.set(loggedIn)
|
||||
})
|
||||
} else {
|
||||
aniListLoggedIn.set(loggedIn)
|
||||
}
|
||||
})
|
||||
}
|
||||
export const LoadAniListUser = async () => {
|
||||
await GetAniListLoggedInUser().then(user => {
|
||||
aniListUser.set(user)
|
||||
})
|
||||
}
|
||||
|
||||
export const LoadAniListWatchList = async () => {
|
||||
await GetAniListUserWatchingList(page, perPage, MediaListSort.UpdatedTimeDesc).then((watchList) => {
|
||||
aniListWatchlist.set(watchList)
|
||||
})
|
||||
}
|
||||
|
||||
export const CheckIfAniListLoggedInAndLoadWatchList = async () => {
|
||||
const loggedIn = await CheckIfAniListLoggedIn()
|
||||
if (loggedIn) {
|
||||
await LoadAniListUser()
|
||||
if (isAniListPrimary) await LoadAniListWatchList()
|
||||
}
|
||||
aniListLoggedIn.set(loggedIn)
|
||||
}
|
||||
</script>
|
Reference in New Issue
Block a user