Fix attaching files to permanent assistant from welcome screen

94c30837a24f8c4b68bcc8dc39e68a327257ea5f

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

1 files changed, +7 -4Ignore whitespace
public/scripts/chats.js+7 -4
@@ -351,10 +351,13 @@ 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- eventSource.once(event_types.CHAT_CHANGED, () => {
355+ const currentChatId = getCurrentChatId();
356- $('#file_form').trigger('reset');
356+ if (currentChatId) {
357- });
357+ eventSource.once(event_types.CHAT_CHANGED, () => {
358+ $('#file_form').trigger('reset');
359+ });
360+ }
358361}
359362
360363/**