Skip to content

Commit 531a1e6

Browse files
committed
fix: The number of members in the contact list
1 parent 6a7ae36 commit 531a1e6

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

module/contactList/ContactList.tsx

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -277,17 +277,21 @@ let ContactList: FC<ContactListProps> = props => {
277277
);
278278
}
279279
if (!contacts) return <div key="no"></div>;
280+
let itemCount = 0;
281+
if (menuItem == 'contacts') {
282+
itemCount = addressStore.contacts.length;
283+
} else if (menuItem == 'groups') {
284+
itemCount = addressStore.groups.length;
285+
} else {
286+
itemCount = renderData[menuItem as 'contacts' | 'groups']?.length;
287+
}
280288

281289
return (
282290
<ContactGroup
283291
title={t(menuItem) as string}
284292
key={menuItem}
285-
unreadCount={
286-
menuItem == 'contacts' ? addressStore.contacts.length : addressStore.groups.length
287-
}
288-
itemCount={
289-
menuItem == 'contacts' ? addressStore.contacts.length : addressStore.groups.length
290-
}
293+
unreadCount={itemCount}
294+
itemCount={itemCount}
291295
itemHeight={74}
292296
hasMenu={hasMenu || menu.length !== 1}
293297
>

0 commit comments

Comments
 (0)