Skip to content

Commit 138cfaa

Browse files
committed
refactor: Add and use playErrorBeep()
1 parent 5316182 commit 138cfaa

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

packages/blockly/core/dragging/block_drag_strategy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ export class BlockDragStrategy implements IDragStrategy {
380380

381381
if (this.moveMode === MoveMode.CONSTRAINED) {
382382
showUnconstrainedMoveHint(this.workspace, true);
383-
this.workspace.getAudioManager().beep(260);
383+
this.workspace.getAudioManager().playErrorBeep();
384384
}
385385
}
386386
}

packages/blockly/core/workspace_audio.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,13 @@ export class WorkspaceAudio {
138138
oscillator.stop(this.context.currentTime + duration);
139139
}
140140

141+
/**
142+
* Plays a standard error beep.
143+
*/
144+
async playErrorBeep() {
145+
return this.beep(260);
146+
}
147+
141148
/**
142149
* Returns whether or not playing sounds is currently allowed.
143150
*

0 commit comments

Comments
 (0)