mirror of
https://github.com/koel/koel
synced 2024-11-10 06:34:14 +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>
|
<script lang="ts" setup>
|
||||||
import { computed, ref, toRef, watch } from 'vue'
|
import { computed, ref, toRef, watch } from 'vue'
|
||||||
import { albumStore, preferenceStore as preferences } from '@/stores'
|
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 AlbumCard from '@/components/album/AlbumCard.vue'
|
||||||
import AlbumCardSkeleton from '@/components/ui/skeletons/ArtistAlbumCardSkeleton.vue'
|
import AlbumCardSkeleton from '@/components/ui/skeletons/ArtistAlbumCardSkeleton.vue'
|
||||||
|
@ -68,7 +69,14 @@ useRouter().onScreenActivated('Albums', async () => {
|
||||||
if (!initialized) {
|
if (!initialized) {
|
||||||
viewMode.value = preferences.albumsViewMode || 'thumbnails'
|
viewMode.value = preferences.albumsViewMode || 'thumbnails'
|
||||||
initialized = true
|
initialized = true
|
||||||
|
|
||||||
|
try {
|
||||||
await makeScrollable()
|
await makeScrollable()
|
||||||
|
} catch (error) {
|
||||||
|
logger.error(error)
|
||||||
|
useMessageToaster().toastError('Failed to load albums.')
|
||||||
|
initialized = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -29,7 +29,8 @@
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, ref, toRef, watch } from 'vue'
|
import { computed, ref, toRef, watch } from 'vue'
|
||||||
import { artistStore, preferenceStore as preferences } from '@/stores'
|
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 ArtistCard from '@/components/artist/ArtistCard.vue'
|
||||||
import ArtistCardSkeleton from '@/components/ui/skeletons/ArtistAlbumCardSkeleton.vue'
|
import ArtistCardSkeleton from '@/components/ui/skeletons/ArtistAlbumCardSkeleton.vue'
|
||||||
|
@ -68,7 +69,14 @@ useRouter().onScreenActivated('Artists', async () => {
|
||||||
if (!initialized) {
|
if (!initialized) {
|
||||||
viewMode.value = preferences.artistsViewMode || 'thumbnails'
|
viewMode.value = preferences.artistsViewMode || 'thumbnails'
|
||||||
initialized = true
|
initialized = true
|
||||||
|
|
||||||
|
try {
|
||||||
await makeScrollable()
|
await makeScrollable()
|
||||||
|
} catch (error) {
|
||||||
|
logger.error(error)
|
||||||
|
useMessageToaster().toastError('Failed to load artists.')
|
||||||
|
initialized = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in a new issue