mirror of
https://github.com/koel/koel
synced 2024-11-28 06:50:27 +00:00
fix: only set initialized to true if artist/album list load is successful (#1629)
This commit is contained in:
parent
9bb4e8c1f0
commit
66e1ee411c
2 changed files with 20 additions and 4 deletions
|
@ -29,7 +29,8 @@
|
|||
<script lang="ts" setup>
|
||||
import { computed, ref, toRef, watch } from 'vue'
|
||||
import { albumStore, preferenceStore as preferences } from '@/stores'
|
||||
import { useInfiniteScroll, useRouter } from '@/composables'
|
||||
import { useInfiniteScroll, useMessageToaster, useRouter } from '@/composables'
|
||||
import { logger } from '@/utils'
|
||||
|
||||
import AlbumCard from '@/components/album/AlbumCard.vue'
|
||||
import AlbumCardSkeleton from '@/components/ui/skeletons/ArtistAlbumCardSkeleton.vue'
|
||||
|
@ -68,7 +69,14 @@ useRouter().onScreenActivated('Albums', async () => {
|
|||
if (!initialized) {
|
||||
viewMode.value = preferences.albumsViewMode || 'thumbnails'
|
||||
initialized = true
|
||||
await makeScrollable()
|
||||
|
||||
try {
|
||||
await makeScrollable()
|
||||
} catch (error) {
|
||||
logger.error(error)
|
||||
useMessageToaster().toastError('Failed to load albums.')
|
||||
initialized = false
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
|
|
@ -29,7 +29,8 @@
|
|||
<script lang="ts" setup>
|
||||
import { computed, ref, toRef, watch } from 'vue'
|
||||
import { artistStore, preferenceStore as preferences } from '@/stores'
|
||||
import { useInfiniteScroll, useRouter } from '@/composables'
|
||||
import { useInfiniteScroll, useMessageToaster, useRouter } from '@/composables'
|
||||
import { logger } from '@/utils'
|
||||
|
||||
import ArtistCard from '@/components/artist/ArtistCard.vue'
|
||||
import ArtistCardSkeleton from '@/components/ui/skeletons/ArtistAlbumCardSkeleton.vue'
|
||||
|
@ -68,7 +69,14 @@ useRouter().onScreenActivated('Artists', async () => {
|
|||
if (!initialized) {
|
||||
viewMode.value = preferences.artistsViewMode || 'thumbnails'
|
||||
initialized = true
|
||||
await makeScrollable()
|
||||
|
||||
try {
|
||||
await makeScrollable()
|
||||
} catch (error) {
|
||||
logger.error(error)
|
||||
useMessageToaster().toastError('Failed to load artists.')
|
||||
initialized = false
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
|
Loading…
Reference in a new issue