Fix: Make modal functions async to support dynamic imports
This commit is contained in:
parent
195cb3f864
commit
f455f17fa3
2 changed files with 5 additions and 5 deletions
|
|
@ -361,26 +361,26 @@ export function createFloatingAIButton() {
|
|||
};
|
||||
|
||||
// Toggle modal on click
|
||||
floatingButton.onclick = () => toggleHermesModal();
|
||||
floatingButton.onclick = async () => await toggleHermesModal();
|
||||
|
||||
document.body.appendChild(floatingButton);
|
||||
console.log('uncloseai.js: Appended floating button to document.body.');
|
||||
}
|
||||
|
||||
// Function to toggle Hermes modal
|
||||
export function toggleHermesModal() {
|
||||
export async function toggleHermesModal() {
|
||||
const existingModal = document.getElementById('hermes-modal');
|
||||
if (existingModal) {
|
||||
document.body.removeChild(existingModal);
|
||||
hermesModalOpen = false;
|
||||
} else {
|
||||
openHermesModal();
|
||||
await openHermesModal();
|
||||
hermesModalOpen = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Function to open Hermes modal
|
||||
export function openHermesModal() {
|
||||
export async function openHermesModal() {
|
||||
// Create modal using dialog element like TTS modal
|
||||
const modal = document.createElement('dialog');
|
||||
modal.id = 'hermes-modal';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue