Flyttat inläsning av apiEndpoint och useModel till frontend.js
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
console.log("client.html - use model: ", useModel);
|
||||
</script> -->
|
||||
|
||||
<script>
|
||||
<!-- <script>
|
||||
let apiEndpoint; // Make variable available outside of the scope of the event listener
|
||||
let useModel; // Make variable available outside of the scope of the event listener
|
||||
window.addEventListener('message', function(event) {
|
||||
@@ -30,9 +30,11 @@
|
||||
const { apiEndpoint, useModel } = event.data;
|
||||
console.log("client.html - API Endpoint: ", apiEndpoint);
|
||||
console.log("client.html - use model: ", useModel);
|
||||
window.apiEndpoint = apiEndpoint;
|
||||
window.useModel = useModel;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</script> -->
|
||||
|
||||
<!-- Marked-it for markdown rendering -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/markdown-it@14.1.0/dist/markdown-it.min.js"></script>
|
||||
@@ -71,7 +73,7 @@
|
||||
event.preventDefault();
|
||||
userInputElement.value += '\n';
|
||||
} else if (event.key === 'Enter') { // Enter to send message
|
||||
sendMessage();
|
||||
window.frontendApi.sendMessage();
|
||||
userInputElement.value = ''; // Clear the input field after sending
|
||||
event.preventDefault();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user