mirror of
https://github.com/khoj-ai/khoj.git
synced 2025-02-17 08:04:21 +00:00
Fix add, remove of the text to speech loader element in Obsidian
This commit is contained in:
parent
814aca6d69
commit
516af86575
1 changed files with 2 additions and 5 deletions
|
@ -318,7 +318,6 @@ export class KhojChatView extends KhojPaneView {
|
|||
speechIcon = event.target as Element;
|
||||
}
|
||||
|
||||
speechButton.innerHTML = "";
|
||||
speechButton.appendChild(loader);
|
||||
speechButton.disabled = true;
|
||||
|
||||
|
@ -339,15 +338,13 @@ export class KhojChatView extends KhojPaneView {
|
|||
source.connect(context.destination);
|
||||
source.start(0);
|
||||
source.onended = function() {
|
||||
speechButton.innerHTML = "";
|
||||
speechButton.appendChild(speechIcon);
|
||||
speechButton.removeChild(loader);
|
||||
speechButton.disabled = false;
|
||||
};
|
||||
})
|
||||
.catch(err => {
|
||||
console.error("Error playing speech:", err);
|
||||
speechButton.innerHTML = "";
|
||||
speechButton.appendChild(speechIcon);
|
||||
speechButton.removeChild(loader);
|
||||
speechButton.disabled = false; // Consider enabling the button again to allow retrying
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue