final w comments

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

@ -155,9 +155,11 @@ export const _getLeftPaneLists = (
}
}
const filterToPrimary = <T extends Array<ConversationType | ConversationListItemPropsType>>(
const filterToPrimary = <
T extends Array<ConversationType | ConversationListItemPropsType>
>(
group: Array<ConversationType | ConversationListItemPropsType>
) : T => {
): T => {
const secondariesToRemove: Array<string> = [];
group.forEach(device => {
if (!device.isSecondary) {
@ -172,17 +174,20 @@ export const _getLeftPaneLists = (
});
// 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> =
filterToPrimary(allFriends);
const receivedFriendsRequest: Array<ConversationListItemPropsType> =
filterToPrimary(allReceivedFriendsRequest);
const sentFriendsRequest: Array<ConversationListItemPropsType> =
filterToPrimary(allSentFriendsRequest);
const friends: Array<ConversationType> = filterToPrimary(allFriends);
const receivedFriendsRequest: Array<
ConversationListItemPropsType
> = filterToPrimary(allReceivedFriendsRequest);
const sentFriendsRequest: Array<
ConversationListItemPropsType
> = filterToPrimary(allSentFriendsRequest);
console.log('[vince] allFriends:', allFriends);
console.log('[vince] friends:', friends);

Loading…
Cancel
Save