Refresh voices when clicking refresh models button

This commit is contained in:
Russell Ballestrini 2025-11-10 05:43:47 -05:00
parent f3d825278a
commit c135bcd6c5

View file

@ -564,19 +564,22 @@ async function openUncloseaiEmbeddedModalNew() {
actionsGrid.className = "uncloseai-grid-actions";
const actions = [
{
text: getUIText("refreshModels"),
{
text: getUIText("refreshModels"),
action: async () => {
const button = event.target;
const originalText = button.textContent;
button.textContent = "🔄 Loading...";
button.disabled = true;
try {
await loadModels();
// Show model count briefly
// Refresh both models and voices
await Promise.all([loadModels(), loadVoices()]);
// Show counts briefly
const modelCount = modelSelect.options.length;
button.textContent = `${modelCount} models`;
const voiceCount = voiceSelect.querySelectorAll('option').length;
button.textContent = `${modelCount} models, ${voiceCount} voices`;
setTimeout(() => {
button.textContent = originalText;
button.disabled = false;