mirror of
https://github.com/koel/koel
synced 2024-11-10 06:34:14 +00:00
fix: intermitten initialization on Home screen
This commit is contained in:
parent
e67cd48855
commit
1c2b44d712
1 changed files with 3 additions and 7 deletions
|
@ -36,7 +36,7 @@
|
|||
<script lang="ts" setup>
|
||||
import { faVolumeOff } from '@fortawesome/free-solid-svg-icons'
|
||||
import { sample } from 'lodash'
|
||||
import { computed, onMounted, ref } from 'vue'
|
||||
import { computed, ref } from 'vue'
|
||||
import { eventBus, noop } from '@/utils'
|
||||
import { commonStore, overviewStore, userStore } from '@/stores'
|
||||
import { useAuthorization, useInfiniteScroll, useScreen } from '@/composables'
|
||||
|
@ -74,18 +74,14 @@ let initialized = false
|
|||
|
||||
eventBus.on(['SONGS_DELETED', 'SONGS_UPDATED'], () => overviewStore.refresh())
|
||||
|
||||
const initialize = async () => {
|
||||
useScreen('Home').onScreenActivated(async () => {
|
||||
if (!initialized) {
|
||||
loading.value = true
|
||||
await overviewStore.init()
|
||||
initialized = true
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(async () => await initialize())
|
||||
|
||||
useScreen('Home').onScreenActivated(async () => await initialize())
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
|
|
Loading…
Reference in a new issue