fix fetch
This commit is contained in:
@@ -3,7 +3,6 @@ import { ref, computed, onMounted, onUnmounted } from "vue";
|
|||||||
import { useSongsStore } from "@/stores/songs";
|
import { useSongsStore } from "@/stores/songs";
|
||||||
|
|
||||||
const songsStore = useSongsStore();
|
const songsStore = useSongsStore();
|
||||||
songsStore.fetchSongs();
|
|
||||||
const idx = ref(0);
|
const idx = ref(0);
|
||||||
const song = computed(() => songsStore.songs[idx.value]);
|
const song = computed(() => songsStore.songs[idx.value]);
|
||||||
|
|
||||||
@@ -17,6 +16,7 @@ function nextSong() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
songsStore.fetchSongs();
|
||||||
nextId = setTimeout(nextSong, 5000);
|
nextId = setTimeout(nextSong, 5000);
|
||||||
refreshId = setInterval(songsStore.fetchSongs, 120000);
|
refreshId = setInterval(songsStore.fetchSongs, 120000);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user