Refresh voices when clicking refresh models button
This commit is contained in:
parent
f3d825278a
commit
c135bcd6c5
1 changed files with 9 additions and 6 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue