Skip to content

Commit 09e8399

Browse files
author
Chris Lorenzo
committed
move announcer into folder
1 parent 6f02fb0 commit 09e8399

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed
File renamed without changes.

src/Accessibility/Announcer.js renamed to src/Accessibility/Announcer/index.js

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,18 @@ function onFocusChangeCore(focusPath = []) {
7070
}
7171

7272
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), []))
7674
}
7775
}
7876

77+
function textToSpeech(toSpeak) {
78+
if (voiceOutDisabled) {
79+
return
80+
}
81+
82+
return (currentlySpeaking = SpeechEngine(toSpeak))
83+
}
84+
7985
const Announcer = {
8086
enabled: true,
8187
debug: false,
@@ -93,7 +99,7 @@ const Announcer = {
9399
currentlySpeaking.append(text)
94100
} else {
95101
Announcer.cancel()
96-
Announcer._textToSpeech(text)
102+
textToSpeech(text)
97103
}
98104

99105
if (notification) {
@@ -107,14 +113,7 @@ const Announcer = {
107113

108114
return currentlySpeaking
109115
},
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 } = {}) {
118117
Announcer.onFocusChange = debounce(onFocusChangeCore, focusDebounce)
119118

120119
resetFocusPathTimer = debounce(() => {
File renamed without changes.

0 commit comments

Comments
 (0)