Skip to content

Commit

Permalink
fix: don't save empty chat
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcMcIntosh committed Mar 19, 2024
1 parent 3683b27 commit 50eafb9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/hooks/useEventBusForChat/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,10 @@ export const useEventBusForChat = () => {
type: EVENT_NAMES_FROM_CHAT.SAVE_CHAT,
payload: state.chat,
};
postMessage(saveMessage);

if (state.chat.messages.length > 0) {
postMessage(saveMessage);
}

const message: CreateNewChatThread = {
type: EVENT_NAMES_TO_CHAT.NEW_CHAT,
Expand Down

0 comments on commit 50eafb9

Please sign in to comment.