add ready flag

This commit is contained in:
ouoertheo
2023-08-22 08:30:33 -05:00
parent 24b6261f46
commit 56fcf1cbb8
5 changed files with 80 additions and 0 deletions

View File

@ -80,6 +80,7 @@ class SystemTtsProvider {
//########//
settings
ready = false
voices = []
separator = ' ... '
@ -145,9 +146,21 @@ class SystemTtsProvider {
$('#system_tts_pitch').val(this.settings.pitch || this.defaultSettings.pitch);
$('#system_tts_pitch_output').text(this.settings.pitch);
$('#system_tts_rate_output').text(this.settings.rate);
this.checkReady()
console.info("Settings loaded");
}
// Perform a simple readiness check by trying to fetch voiceIds
async checkReady(){
try {
await this.fetchTtsVoiceIds()
this.ready = true
} catch {
this.ready = false
}
}
async onApplyClick() {
return
}