nice improvements to the audio queue

This commit is contained in:
Arjun Patel
2022-01-22 00:53:23 -08:00
parent 892d3f7dd4
commit a1ef8f7883
3 changed files with 11 additions and 4 deletions
+9 -2
View File
@@ -548,8 +548,15 @@ export default function KeyboardContextProvider({ children }) {
const [playerSrc, setPlayerSrc] = useState<string>(null);
function handleAddAudioToQueue(urls: string[]) {
setAudioQueue((prevQueue) => [...prevQueue, ...urls]);
function handleAddAudioToQueue(
urls: string[],
clearEverythingElse: boolean = false
) {
if (clearEverythingElse) {
setAudioQueue(urls);
} else {
setAudioQueue((prevQueue) => [...prevQueue, ...urls]);
}
}
function startAnnouncement() {