File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -277,17 +277,21 @@ let ContactList: FC<ContactListProps> = props => {
277
277
) ;
278
278
}
279
279
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
+ }
280
288
281
289
return (
282
290
< ContactGroup
283
291
title = { t ( menuItem ) as string }
284
292
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 }
291
295
itemHeight = { 74 }
292
296
hasMenu = { hasMenu || menu . length !== 1 }
293
297
>
You can’t perform that action at this time.
0 commit comments