@@ -5,7 +5,8 @@ export default {
position: 1,
maxPosition: 1,
gettingSet: false,
- loadAllSongs: false
+ loadAllSongs: false,
+ interval: null
};
},
computed: {
@@ -29,8 +30,18 @@ export default {
loadAll() {
this.loadAllSongs = true;
- this.getSet();
+ this.interval = setInterval(() => {
+ if (this.loadAllSongs && this.maxPosition > this.position)
+ this.getSet();
+ else {
+ clearInterval(this.interval);
+ this.loadAllSongs = false;
+ }
+ }, 500);
}
+ },
+ unmounted() {
</script>
@@ -201,14 +201,6 @@ export default {
this.maxPosition = Math.ceil(length / 15) + 1;
this.getSet();
-
- setTimeout(() => {
- if (
- !this.loadAllSongs &&
- this.maxPosition > this.position - 1
- )
- }, 1000);
});
this.socket.emit("apis.joinAdminRoom", "queue", () => {});
@@ -179,14 +179,6 @@ export default {
this.socket.emit("apis.joinAdminRoom", "songs", () => {});