Merge pull request #1277 from CoryG89/bug-race-condition-tts-autoload-chat

Fix duplicate TTS voicemap UI when autoload last chat is enabled
This commit is contained in:
Cohee 2023-10-23 00:25:30 +03:00 committed by GitHub
commit a4fe78f8ba
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()