refactor: replace global audio instance with inline audio creation in snackbar
All checks were successful
Code quality checks / biome (push) Successful in 11s
All checks were successful
Code quality checks / biome (push) Successful in 11s
This commit is contained in:
parent
7289a541f8
commit
8d76c55539
1 changed files with 1 additions and 4 deletions
|
@ -89,16 +89,13 @@ interface Options {
|
|||
onClosed?: (snackbar: Snackbar) => void;
|
||||
}
|
||||
|
||||
const popcorn = new Audio("https://no.ipv4.army/raw/Popcorn.ogg");
|
||||
|
||||
export const snacker = (opts: Options) => {
|
||||
snackbar({
|
||||
closeable: true,
|
||||
messageLine: 2,
|
||||
queue: "snacker",
|
||||
onOpen: () => {
|
||||
popcorn.currentTime = 0;
|
||||
popcorn.play();
|
||||
new Audio("https://no.ipv4.army/raw/Popcorn.ogg").play();
|
||||
},
|
||||
|
||||
...opts,
|
||||
|
|
Loading…
Add table
Reference in a new issue