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