fix: new-chat confirm uses the site dialog; remove assistant intro paragraph
All checks were successful
Forgejo Android APK / Root app tests (push) Successful in 24s
Forgejo Android APK / Build signed APK (push) Successful in 2m6s

This commit is contained in:
Daniel 2026-09-08 16:38:08 +02:00
parent 81abc60591
commit 17a0ebe68b
2 changed files with 14 additions and 2 deletions

View file

@ -1,7 +1,6 @@
<div class="module-header assistant-header">
<div>
<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 class="assistant-status" id="assistant-status">
<span class="assistant-dot"></span>

View file

@ -656,7 +656,20 @@ import {
function clearConversation(event) {
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();
messages = [];
attachments = [];