provided codeOverride for playClick so that settings will properly be able to preview certain sounds (#4246) jerryzhou196

This commit is contained in:
Jerry Zhou 2023-05-02 08:16:40 -04:00 committed by GitHub
parent 9776907343
commit 7ee47a83f2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -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;
}

View file

@ -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(