mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
add ready flag
This commit is contained in:
@ -6,6 +6,7 @@ class ElevenLabsTtsProvider {
|
||||
//########//
|
||||
|
||||
settings
|
||||
ready = false
|
||||
voices = []
|
||||
separator = ' ... ... ... '
|
||||
|
||||
@ -66,9 +67,22 @@ class ElevenLabsTtsProvider {
|
||||
$('#elevenlabs_tts_similarity_boost').val(this.settings.similarity_boost)
|
||||
$('#elevenlabs_tts_api_key').val(this.settings.apiKey)
|
||||
$('#tts_auto_generation').prop('checked', this.settings.multilingual)
|
||||
|
||||
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() {
|
||||
// Update on Apply click
|
||||
return await this.updateApiKey().catch( (error) => {
|
||||
|
Reference in New Issue
Block a user