mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-05 04:53:01 +00:00
add a buggy method to clear queue
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="queue-actions">
|
<div class="queue-actions">
|
||||||
<div class="left">
|
<div class="left">
|
||||||
<button class="clear-queue action">
|
<button class="clear-queue action" @click="queue.clearQueue">
|
||||||
<ClearSvg />
|
<ClearSvg />
|
||||||
<span>Clear</span>
|
<span>Clear</span>
|
||||||
</button>
|
</button>
|
||||||
@@ -19,9 +19,13 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import useQueueStore from "../../../stores/queue";
|
||||||
|
|
||||||
import ClearSvg from "@/assets/icons/delete.svg";
|
import ClearSvg from "@/assets/icons/delete.svg";
|
||||||
import SaveAsPlaylistSvg from "@/assets/icons/sdcard.svg";
|
import SaveAsPlaylistSvg from "@/assets/icons/sdcard.svg";
|
||||||
import MoreSvg from "@/assets/icons/more.svg";
|
import MoreSvg from "@/assets/icons/more.svg";
|
||||||
|
|
||||||
|
const queue = useQueueStore();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
|||||||
@@ -239,5 +239,14 @@ export default defineStore("Queue", {
|
|||||||
);
|
);
|
||||||
writeQueue(this.from, this.tracks);
|
writeQueue(this.from, this.tracks);
|
||||||
},
|
},
|
||||||
|
clearQueue() {
|
||||||
|
this.tracks = [defaultTrack] as Track[];
|
||||||
|
this.current = 0;
|
||||||
|
this.currentid = "";
|
||||||
|
this.next = 0;
|
||||||
|
this.prev = 0;
|
||||||
|
this.from = <From>{};
|
||||||
|
console.log(this.current);
|
||||||
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user