diff --git a/public/script.js b/public/script.js index c4b8aaa36..25880b6cf 100644 --- a/public/script.js +++ b/public/script.js @@ -1158,9 +1158,8 @@ export async function reloadCurrentChat() { else { resetChatState(); await printMessages(); + await eventSource.emit(event_types.CHAT_CHANGED, getCurrentChatId()); } - - await eventSource.emit(event_types.CHAT_CHANGED, getCurrentChatId()); } function messageFormatting(mes, ch_name, isSystem, isUser) { diff --git a/public/scripts/group-chats.js b/public/scripts/group-chats.js index b22577959..dee35bbea 100644 --- a/public/scripts/group-chats.js +++ b/public/scripts/group-chats.js @@ -197,7 +197,7 @@ export async function getGroupChat(groupId) { updateChatMetadata(metadata, true); } - eventSource.emit(event_types.CHAT_CHANGED, getCurrentChatId()); + await eventSource.emit(event_types.CHAT_CHANGED, getCurrentChatId()); } /**