mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2024-09-22 16:26:18 +08:00
provided codeOverride for playClick so that settings will properly be able to preview certain sounds (#4246) jerryzhou196
This commit is contained in:
parent
9776907343
commit
7ee47a83f2
|
@ -474,7 +474,7 @@ export function playNote(
|
|||
oscillatorNode.stop(audioCtx.currentTime + 0.5);
|
||||
}
|
||||
|
||||
export function playClick(): void {
|
||||
export function playClick(codeOverride?: string): void {
|
||||
if (Config.playSoundOnClick === "off") return;
|
||||
|
||||
if (Config.playSoundOnClick in scaleConfigurations) {
|
||||
|
@ -487,7 +487,7 @@ export function playClick(): void {
|
|||
}
|
||||
|
||||
if (Config.playSoundOnClick in clickSoundIdsToOscillatorType) {
|
||||
playNote();
|
||||
playNote(codeOverride ?? undefined);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -253,7 +253,7 @@ async function initGroups(): Promise<void> {
|
|||
UpdateConfig.setPlaySoundOnClick,
|
||||
"button",
|
||||
() => {
|
||||
if (Config.playSoundOnClick !== "off") Sound.playClick();
|
||||
if (Config.playSoundOnClick !== "off") Sound.playClick("KeyQ");
|
||||
}
|
||||
);
|
||||
groups["showAllLines"] = new SettingsGroup(
|
||||
|
|
Loading…
Reference in a new issue