fix: new-chat confirm uses the site dialog; remove assistant intro paragraph
This commit is contained in:
parent
81abc60591
commit
17a0ebe68b
2 changed files with 14 additions and 2 deletions
|
|
@ -1,7 +1,6 @@
|
||||||
<div class="module-header assistant-header">
|
<div class="module-header assistant-header">
|
||||||
<div>
|
<div>
|
||||||
<h2><i class="fas fa-brain" style="color:var(--purple);"></i> AI Clinical Assistant</h2>
|
<h2><i class="fas fa-brain" style="color:var(--purple);"></i> AI Clinical Assistant</h2>
|
||||||
<p>Ask focused clinical questions over indexed Nextcloud books/resources, or ask for a teaching image directly in the chat box.</p>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="assistant-status" id="assistant-status">
|
<div class="assistant-status" id="assistant-status">
|
||||||
<span class="assistant-dot"></span>
|
<span class="assistant-dot"></span>
|
||||||
|
|
|
||||||
|
|
@ -656,7 +656,20 @@ import {
|
||||||
|
|
||||||
function clearConversation(event) {
|
function clearConversation(event) {
|
||||||
if (assistantBusy && !activeAssistantRequest) return;
|
if (assistantBusy && !activeAssistantRequest) return;
|
||||||
if (event && messages.length && !window.confirm('Start a new chat? Save or download this conversation first if you want to keep it.')) return;
|
if (event && messages.length) {
|
||||||
|
// Use the site's standard inline dialog instead of the native confirm().
|
||||||
|
if (typeof showConfirm === 'function') {
|
||||||
|
showConfirm('Start a new chat? Save or download this conversation first if you want to keep it.', function() {
|
||||||
|
performClearConversation();
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!window.confirm('Start a new chat? Save or download this conversation first if you want to keep it.')) return;
|
||||||
|
}
|
||||||
|
performClearConversation();
|
||||||
|
}
|
||||||
|
|
||||||
|
function performClearConversation() {
|
||||||
if (activeAssistantRequest) cancelAssistantSearch();
|
if (activeAssistantRequest) cancelAssistantSearch();
|
||||||
messages = [];
|
messages = [];
|
||||||
attachments = [];
|
attachments = [];
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue