cleanup
This commit is contained in:
@@ -101,6 +101,7 @@ export function ConversationList() {
|
|||||||
key={`${currentConversation._id.toString()}-priorityConvoList`}
|
key={`${currentConversation._id.toString()}-priorityConvoList`}
|
||||||
conversation={currentConversation}
|
conversation={currentConversation}
|
||||||
index={index}
|
index={index}
|
||||||
|
isPriority={true}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
</List>
|
</List>
|
||||||
@@ -123,6 +124,7 @@ export function ConversationList() {
|
|||||||
key={`${currentConversation._id.toString()}-inboxConvoList`}
|
key={`${currentConversation._id.toString()}-inboxConvoList`}
|
||||||
conversation={currentConversation}
|
conversation={currentConversation}
|
||||||
index={index}
|
index={index}
|
||||||
|
isPriority={false}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
</List>
|
</List>
|
||||||
@@ -139,10 +141,12 @@ export function ConversationRow({
|
|||||||
conversation,
|
conversation,
|
||||||
index,
|
index,
|
||||||
onClick,
|
onClick,
|
||||||
|
isPriority = false,
|
||||||
}: {
|
}: {
|
||||||
conversation: MasterConversation;
|
conversation: MasterConversation;
|
||||||
index?: number;
|
index?: number;
|
||||||
onClick?: () => void;
|
onClick?: () => void;
|
||||||
|
isPriority?: boolean;
|
||||||
}) {
|
}) {
|
||||||
const { user } = useAuth();
|
const { user } = useAuth();
|
||||||
|
|
||||||
@@ -159,21 +163,6 @@ export function ConversationRow({
|
|||||||
selectConversation(conversation._id.toString(), false);
|
selectConversation(conversation._id.toString(), false);
|
||||||
}, [conversation, selectConversation, onClick]);
|
}, [conversation, selectConversation, onClick]);
|
||||||
|
|
||||||
const currentConversationMember = useMemo(() => {
|
|
||||||
const currentConvoMember = conversation.members.find(
|
|
||||||
(mem) => mem._id.toString() === user._id.toString(),
|
|
||||||
);
|
|
||||||
return currentConvoMember;
|
|
||||||
}, [conversation.members, user]);
|
|
||||||
|
|
||||||
const isPriority = useMemo(() => {
|
|
||||||
if (currentConversationMember && currentConversationMember.memberState === 'priority') {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}, [currentConversationMember]);
|
|
||||||
|
|
||||||
const keyboardShortcut = useMemo(() => {
|
const keyboardShortcut = useMemo(() => {
|
||||||
if (index < NirvanaRules.topXConversationsWithShortcuts && isPriority) {
|
if (index < NirvanaRules.topXConversationsWithShortcuts && isPriority) {
|
||||||
return index + 1;
|
return index + 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user