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) {
351351 $('#file_form .file_size').text(humanFileSize(file.size));
352352 $('#file_form').removeClass('displayNone');
353353
354354 // Reset form on chat change (if not on a welcome screen)
355+ const currentChatId = getCurrentChatId();
356+ if (currentChatId) {
355357 eventSource.once(event_types.CHAT_CHANGED, () => {
356358 $('#file_form').trigger('reset');
357359 });
358360 }
361+}
359362
360363/**
361364 * Deletes file from message.