smoother flow not duplicating selections
This commit is contained in:
@@ -216,6 +216,7 @@ export function ConversationProvider({ children }: { children: React.ReactNode }
|
||||
* set the temporary sort accordingly
|
||||
*/
|
||||
|
||||
// if we are try to clear or escape most likely
|
||||
if (!conversationId) {
|
||||
setSelectedConversation((prevConversation) => {
|
||||
// untuned from previous line
|
||||
@@ -233,6 +234,11 @@ export function ConversationProvider({ children }: { children: React.ReactNode }
|
||||
return;
|
||||
}
|
||||
|
||||
// if we are selecting same one, don't run more logic
|
||||
if (selectedConversation?._id.toString() === conversationId) {
|
||||
return;
|
||||
}
|
||||
|
||||
const allConversationIds = Object.keys(conversationMap);
|
||||
let conversationToSelect: MasterConversation;
|
||||
|
||||
@@ -286,6 +292,7 @@ export function ConversationProvider({ children }: { children: React.ReactNode }
|
||||
[
|
||||
user,
|
||||
conversationMap,
|
||||
selectedConversation,
|
||||
setSelectedConversation,
|
||||
setConversationMap,
|
||||
handleUntuneFromLine,
|
||||
|
||||
Reference in New Issue
Block a user