Skip to content

Commit b0271e1

Browse files
perf: Assistant full-screen embedding code optimization
1 parent c335773 commit b0271e1

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

frontend/src/views/system/embedded/iframe.vue

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -407,11 +407,13 @@ const handleEmbedded = (row: any) => {
407407
script.src = "${origin + pathname}xpack_static/sqlbot-embedded-dynamic.umd.js";
408408
document.head.appendChild(script);
409409
})()
410-
411-
sqlbot_embedded_handler.mounted('.copilot', {
412-
"embeddedId": "${row.id}",
413-
"online": true
414-
})`
410+
let sqlbot_embedded_timer = setInterval(() => {
411+
if (sqlbot_embedded_handler?.mounted) {
412+
sqlbot_embedded_handler.mounted('.copilot', { "embeddedId": "${row.id}" })
413+
clearInterval(sqlbot_embedded_timer)
414+
}
415+
}, 1000)
416+
`
415417
}
416418
const copyJsCode = () => {
417419
copy(jsCodeElement.value)

0 commit comments

Comments
 (0)