final w comments

pull/1129/head
Vincent 5 years ago
parent 2b0ea5bcc5
commit 08e223e96e

@ -155,7 +155,9 @@ export const _getLeftPaneLists = (
} }
} }
const filterToPrimary = <T extends Array<ConversationType | ConversationListItemPropsType>>( const filterToPrimary = <
T extends Array<ConversationType | ConversationListItemPropsType>
>(
group: Array<ConversationType | ConversationListItemPropsType> group: Array<ConversationType | ConversationListItemPropsType>
): T => { ): T => {
const secondariesToRemove: Array<string> = []; const secondariesToRemove: Array<string> = [];
@ -172,17 +174,20 @@ export const _getLeftPaneLists = (
}); });
// tslint:disable-next-line: no-unnecessary-local-variable // tslint:disable-next-line: no-unnecessary-local-variable
const filteredGroup = group.filter(c => !(secondariesToRemove.find(s => s === c.id))); const filteredGroup = group.filter(
c => !secondariesToRemove.find(s => s === c.id)
);
return (filteredGroup as T); return filteredGroup as T;
}; };
const friends: Array<ConversationType> = const friends: Array<ConversationType> = filterToPrimary(allFriends);
filterToPrimary(allFriends); const receivedFriendsRequest: Array<
const receivedFriendsRequest: Array<ConversationListItemPropsType> = ConversationListItemPropsType
filterToPrimary(allReceivedFriendsRequest); > = filterToPrimary(allReceivedFriendsRequest);
const sentFriendsRequest: Array<ConversationListItemPropsType> = const sentFriendsRequest: Array<
filterToPrimary(allSentFriendsRequest); ConversationListItemPropsType
> = filterToPrimary(allSentFriendsRequest);
console.log('[vince] allFriends:', allFriends); console.log('[vince] allFriends:', allFriends);
console.log('[vince] friends:', friends); console.log('[vince] friends:', friends);

Loading…
Cancel
Save