Fix race condition duplicates TTS UI if autoload chat enabled

This commit is contained in:
Cory Gross 2023-10-22 08:54:25 -07:00 committed by GitHub
parent 600c9c6251
commit 5b2fff07b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -749,10 +749,6 @@ class VoiceMapEntry {
*
*/
export async function initVoiceMap(){
// Clear existing voiceMap state
$('#tts_voicemap_block').empty()
voiceMapEntries = []
// Gate initialization if not enabled or TTS Provider not ready. Prevents error popups.
const enabled = $('#tts_enabled').is(':checked')
if (!enabled){
@ -770,6 +766,10 @@ export async function initVoiceMap(){
setTtsStatus("TTS Provider Loaded", true)
// Clear existing voiceMap state
$('#tts_voicemap_block').empty()
voiceMapEntries = []
// Get characters in current chat
const characters = getCharacters()