Skip to content

Commit

Permalink
small js improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisclark committed May 4, 2024
1 parent 8d449a4 commit eaaf64e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
16 changes: 7 additions & 9 deletions explorer/src/js/assistant.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,13 @@ function submitAssistantAsk() {
// If there is exactly one code block in the response and the SQL editor is empty
// then copy the code directly into the editor
const preElements = document.querySelectorAll('#assistant_response pre');
if (preElements.length === 1) {
if (window.editor?.state.doc.toString().trim() === "") {
window.editor.dispatch({
changes: {
from: 0,
insert: preElements[0].textContent
}
});
}
if (preElements.length === 1 && window.editor?.state.doc.toString().trim() === "") {
window.editor.dispatch({
changes: {
from: 0,
insert: preElements[0].textContent
}
});
}

setUpCopyButtons();
Expand Down
2 changes: 1 addition & 1 deletion explorer/src/js/explorer.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function updateSchema() {
});
});

$("#schema_frame").attr("src", "../schema/" + conn);
$("#schema_frame").attr("src", `../schema/{conn}`);
}


Expand Down

0 comments on commit eaaf64e

Please sign in to comment.