Skip to content

Commit

Permalink
Remove dupes from Connection lists; match Groups listItem height to C…
Browse files Browse the repository at this point in the history
…ontacts
  • Loading branch information
zdmc23 committed May 4, 2021
1 parent 8c29568 commit 93ac17c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
5 changes: 3 additions & 2 deletions screens/Contact/ContactDetailScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -1668,7 +1668,9 @@ class ContactDetailScreen extends React.Component {
}
});
}
return items;
// remove dupes
const set = new Set(items.map((item) => JSON.stringify(item)));
return [...set].map((item) => JSON.parse(item));
};

onViewOnMobileWeb = () => {
Expand Down Expand Up @@ -3777,7 +3779,6 @@ class ContactDetailScreen extends React.Component {
} else {
switch (postType) {
case 'contacts': {
//listItems = [...this.state.usersContacts];
listItems = [
...this.state.subAssignedContacts,
...this.state.relationContacts,
Expand Down
6 changes: 4 additions & 2 deletions screens/Group/GroupDetailScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -1315,7 +1315,9 @@ class GroupDetailScreen extends React.Component {
}
});
}
return items;
// remove dupes
const set = new Set(items.map((item) => JSON.stringify(item)));
return [...set].map((item) => JSON.parse(item));
};

renderActivityOrCommentRow = (commentOrActivity) => (
Expand Down Expand Up @@ -3568,7 +3570,7 @@ class GroupDetailScreen extends React.Component {
break;
}
case 'groups': {
collection = [...this.state.groups];
collection = [...this.state.connectionGroups, ...this.state.groups];
isGroup = true;
break;
}
Expand Down
2 changes: 1 addition & 1 deletion screens/Group/GroupsScreen.styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { StyleSheet } from 'react-native';

export const styles = StyleSheet.create({
flatListItem: {
height: 40 /* this needs auto sizing */,
height: 55,
margin: 20,
marginTop: 10,
paddingBottom: 10,
Expand Down
1 change: 0 additions & 1 deletion shared/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ const formatDateToDatePicker = (timestamp = null) => {
};

const getSelectorColor = (status) => {
console.log(`status: ${status}`);
let newColor;
if (status === 'new' || status === 'unassigned' || status === 'inactive') {
newColor = '#d9534f';
Expand Down

0 comments on commit 93ac17c

Please sign in to comment.