From a8a8dca7c01183a364cf69ae7feee85848c9e18b Mon Sep 17 00:00:00 2001 From: Junlin Zhou Date: Wed, 21 Feb 2024 12:38:11 +0800 Subject: [PATCH] fix: prevent duplicate dispatch --- web/src/routes/conversation/ChatInput/index.jsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/web/src/routes/conversation/ChatInput/index.jsx b/web/src/routes/conversation/ChatInput/index.jsx index 28bbe068..843d12da 100644 --- a/web/src/routes/conversation/ChatInput/index.jsx +++ b/web/src/routes/conversation/ChatInput/index.jsx @@ -63,8 +63,7 @@ const ChatInput = ({ conv }) => { type: "reordered", conv: { id: conv.id, last_message_at: new Date().toISOString() }, }); - } - if (groupedConvs.Today && groupedConvs.Today[0]?.id !== conv.id) { + } else if (groupedConvs.Today && groupedConvs.Today[0]?.id !== conv.id) { dispatchConv({ type: "reordered", conv: { id: conv.id, last_message_at: new Date().toISOString() },