Skip to content

Commit

Permalink
Change default silence duration
Browse files Browse the repository at this point in the history
  • Loading branch information
64json committed Jul 29, 2020
1 parent 0c19ccc commit cff77e2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export class GeoMapNavigationComponent implements GeoMapNavigationPreference, On
}

ngOnInit() {
this.screenReaderComponent.breakSilence(tA11y(AUDIFICATION.BREAK_SILENCE), 3000);
this.screenReaderComponent.breakSilence(tA11y(AUDIFICATION.BREAK_SILENCE));

merge(
this.host.filteringTerritory$
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export class LineChartAudificationComponent implements AudificationPreference, O
}

ngOnInit() {
this.screenReaderComponent.breakSilence(tA11y(AUDIFICATION.BREAK_SILENCE), 3000);
this.screenReaderComponent.breakSilence(tA11y(AUDIFICATION.BREAK_SILENCE));

combineLatest([
this.host.data$,
Expand Down
4 changes: 3 additions & 1 deletion src/components/screen-reader/screen-reader.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { Subject } from 'rxjs';
import * as numbered from 'numbered';
import { debounceTime, filter, takeUntil } from 'rxjs/operators';

const defaultSilenceDuration = 5000;

@Component({
selector: 'app-screen-reader',
templateUrl: './screen-reader.component.html',
Expand Down Expand Up @@ -65,7 +67,7 @@ export class ScreenReaderComponent implements OnDestroy {
* @param text The text to read out.
* @param silenceDuration The duration of silence.
*/
breakSilence(text: string, silenceDuration: number) {
breakSilence(text: string, silenceDuration = defaultSilenceDuration) {
return this.silence$
.pipe(takeUntil(this.destroy$))
.pipe(debounceTime(silenceDuration))
Expand Down

0 comments on commit cff77e2

Please sign in to comment.