fix modal crash: defer settings state apply until controls element exists
This commit is contained in:
parent
7aad5d154c
commit
d8d8472460
1 changed files with 6 additions and 5 deletions
|
|
@ -1101,11 +1101,7 @@ async function openUncloseaiEmbeddedModalNew() {
|
|||
function applySettingsState() {
|
||||
settingsPanel.classList.toggle("open", settingsOpen);
|
||||
chatArea.style.display = settingsOpen ? "none" : "";
|
||||
controls.style.display = settingsOpen ? "none" : "";
|
||||
}
|
||||
|
||||
if (settingsOpen) {
|
||||
applySettingsState();
|
||||
if (controls) controls.style.display = settingsOpen ? "none" : "";
|
||||
}
|
||||
|
||||
menuBtn.onclick = () => {
|
||||
|
|
@ -1134,6 +1130,11 @@ async function openUncloseaiEmbeddedModalNew() {
|
|||
const controls = document.createElement("div");
|
||||
controls.className = "uncloseai-modal-controls";
|
||||
|
||||
// Apply initial settings state now that controls exists
|
||||
if (settingsOpen) {
|
||||
applySettingsState();
|
||||
}
|
||||
|
||||
// HTML to Markdown converter function
|
||||
function htmlToMarkdown(html) {
|
||||
// Create a temporary element to parse HTML
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue