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;
|
onClosed?: (snackbar: Snackbar) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
const popcorn = new Audio("https://no.ipv4.army/raw/Popcorn.ogg");
|
|
||||||
|
|
||||||
export const snacker = (opts: Options) => {
|
export const snacker = (opts: Options) => {
|
||||||
snackbar({
|
snackbar({
|
||||||
closeable: true,
|
closeable: true,
|
||||||
messageLine: 2,
|
messageLine: 2,
|
||||||
queue: "snacker",
|
queue: "snacker",
|
||||||
onOpen: () => {
|
onOpen: () => {
|
||||||
popcorn.currentTime = 0;
|
new Audio("https://no.ipv4.army/raw/Popcorn.ogg").play();
|
||||||
popcorn.play();
|
|
||||||
},
|
},
|
||||||
|
|
||||||
...opts,
|
...opts,
|
||||||
|
|
Loading…
Add table
Reference in a new issue