Fix attaching files to permanent assistant from welcome screen

94c30837a24f8c4b68bcc8dc39e68a327257ea5f

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +4 -1Showing whitespace changes
public/scripts/chats.js+4 -1
@@ -351,11 +351,14 @@ async function onFileAttach(file) {
351 $('#file_form .file_size').text(humanFileSize(file.size));351 $('#file_form .file_size').text(humanFileSize(file.size));
352 $('#file_form').removeClass('displayNone');352 $('#file_form').removeClass('displayNone');
353353
354 // Reset form on chat change354 // Reset form on chat change (if not on a welcome screen)
355 const currentChatId = getCurrentChatId();
356 if (currentChatId) {
355 eventSource.once(event_types.CHAT_CHANGED, () => {357 eventSource.once(event_types.CHAT_CHANGED, () => {
356 $('#file_form').trigger('reset');358 $('#file_form').trigger('reset');
357 });359 });
358 }360 }
361}
359362
360/**363/**
361 * Deletes file from message.364 * Deletes file from message.