Fix issue on Safari: audio not playing on first toggle

This commit is contained in:
Christian Semmler 2026-01-30 15:01:30 -08:00
parent b5389b2685
commit ff379338f9
No known key found for this signature in database
GPG Key ID: 086DAA1360BEEE5C

View File

@ -17,8 +17,14 @@ export function playInstallAudio() {
const audio = getInstallAudio(); const audio = getInstallAudio();
if (audio) { if (audio) {
audio.currentTime = 0; audio.currentTime = 0;
audio.play(); audio.load();
audio.play()
.then(() => {
soundEnabled.set(true); soundEnabled.set(true);
})
.catch(() => {
soundEnabled.set(false);
});
} }
} }