Fix attaching files to permanent assistant from welcome screen

This commit is contained in:
Cohee
2025-05-21 22:39:49 +03:00
parent 3486303d7c
commit 94c30837a2

View File

@ -351,11 +351,14 @@ async function onFileAttach(file) {
$('#file_form .file_size').text(humanFileSize(file.size)); $('#file_form .file_size').text(humanFileSize(file.size));
$('#file_form').removeClass('displayNone'); $('#file_form').removeClass('displayNone');
// Reset form on chat change // Reset form on chat change (if not on a welcome screen)
const currentChatId = getCurrentChatId();
if (currentChatId) {
eventSource.once(event_types.CHAT_CHANGED, () => { eventSource.once(event_types.CHAT_CHANGED, () => {
$('#file_form').trigger('reset'); $('#file_form').trigger('reset');
}); });
} }
}
/** /**
* Deletes file from message. * Deletes file from message.