File tree Expand file tree Collapse file tree 3 files changed +11
-12
lines changed
src/Accessibility/Announcer Expand file tree Collapse file tree 3 files changed +11
-12
lines changed File renamed without changes.
Original file line number Diff line number Diff line change @@ -70,12 +70,18 @@ function onFocusChangeCore(focusPath = []) {
70
70
}
71
71
72
72
if ( toAnnounceText . length ) {
73
- return Announcer . speak (
74
- toAnnounceText . reduce ( ( acc , val ) => acc . concat ( val ) , [ ] )
75
- )
73
+ return Announcer . speak ( toAnnounceText . reduce ( ( acc , val ) => acc . concat ( val ) , [ ] ) )
76
74
}
77
75
}
78
76
77
+ function textToSpeech ( toSpeak ) {
78
+ if ( voiceOutDisabled ) {
79
+ return
80
+ }
81
+
82
+ return ( currentlySpeaking = SpeechEngine ( toSpeak ) )
83
+ }
84
+
79
85
const Announcer = {
80
86
enabled : true ,
81
87
debug : false ,
@@ -93,7 +99,7 @@ const Announcer = {
93
99
currentlySpeaking . append ( text )
94
100
} else {
95
101
Announcer . cancel ( )
96
- Announcer . _textToSpeech ( text )
102
+ textToSpeech ( text )
97
103
}
98
104
99
105
if ( notification ) {
@@ -107,14 +113,7 @@ const Announcer = {
107
113
108
114
return currentlySpeaking
109
115
} ,
110
- _textToSpeech ( toSpeak ) {
111
- if ( voiceOutDisabled ) {
112
- return
113
- }
114
-
115
- return ( currentlySpeaking = SpeechEngine ( toSpeak ) )
116
- } ,
117
- setupTimers : function ( { focusDebounce = 400 , focusChangeTimeout = fiveMinutes } = { } ) {
116
+ setupTimers : function ( { focusDebounce = 400 , focusChangeTimeout = fiveMinutes } = { } ) {
118
117
Announcer . onFocusChange = debounce ( onFocusChangeCore , focusDebounce )
119
118
120
119
resetFocusPathTimer = debounce ( ( ) => {
File renamed without changes.
You can’t perform that action at this time.
0 commit comments