Skip to content

Commit

Permalink
eliminate dependency on NumberSuiteCommonSpeechSynthesisAnnouncer in …
Browse files Browse the repository at this point in the history
…AutoHearControl, phetsims/number-pairs#22
  • Loading branch information
pixelzoom committed Dec 9, 2024
1 parent f78cd73 commit 143867a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions js/common/view/AutoHearControl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import ToggleSwitch from '../../../../sun/js/ToggleSwitch.js';
import numberSuiteCommon from '../../numberSuiteCommon.js';
import NumberSuiteCommonStrings from '../../NumberSuiteCommonStrings.js';
import NumberSuiteCommonConstants from '../NumberSuiteCommonConstants.js';
import NumberSuiteCommonSpeechSynthesisAnnouncer from './NumberSuiteCommonSpeechSynthesisAnnouncer.js';
import Property from '../../../../axon/js/Property.js';

const MISSING_VOICE_WARNING_TEXT_OPTIONS: TextOptions = {
Expand All @@ -33,7 +32,7 @@ export default class AutoHearControl extends Node {

public constructor(
autoHearEnabledProperty: Property<boolean>,
speechSynthesisAnnouncer: NumberSuiteCommonSpeechSynthesisAnnouncer,
hasVoiceProperty: TReadOnlyProperty<boolean>,
labelStringProperty: TReadOnlyProperty<string>,
descriptionStringProperty: TReadOnlyProperty<string>,
visible = true
Expand Down Expand Up @@ -79,7 +78,7 @@ export default class AutoHearControl extends Node {
spacing: 14,
align: 'center',
visibleProperty: new DerivedProperty(
[ autoHearEnabledProperty, speechSynthesisAnnouncer.hasVoiceProperty ],
[ autoHearEnabledProperty, hasVoiceProperty ],
( autoHearEnabled, hasVoice ) => autoHearEnabled && !hasVoice
)
} );
Expand Down

0 comments on commit 143867a

Please sign in to comment.