Skip to content

Commit ad089b0

Browse files
committed
handle voice test error
1 parent 9c5e9f7 commit ad089b0

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

js/options.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -262,13 +262,16 @@
262262
rxjs.startWith({state: "STOPPED"})
263263
)
264264
)
265-
).subscribe(({state, playbackError}) => {
266-
$("#test-voice .spinner").toggle(state == "LOADING")
267-
$("#test-voice [data-i18n]").text(
268-
brapi.i18n.getMessage(state == "STOPPED" ? "options_test_button" : "options_stop_button")
269-
)
270-
if (state == "STOPPED" && playbackError) handleError(playbackError)
271-
else $("#status").parent().hide()
265+
).subscribe({
266+
next({state, playbackError}) {
267+
$("#test-voice .spinner").toggle(state == "LOADING")
268+
$("#test-voice [data-i18n]").text(
269+
brapi.i18n.getMessage(state == "STOPPED" ? "options_test_button" : "options_stop_button")
270+
)
271+
if (state == "STOPPED" && playbackError) handleError(playbackError)
272+
else $("#status").parent().hide()
273+
},
274+
error: handleError
272275
})
273276

274277

0 commit comments

Comments
 (0)