Skip to content
This repository has been archived by the owner on Oct 11, 2022. It is now read-only.

Commit

Permalink
Merge pull request #5302 from withspectrum/channel-settings-refresh
Browse files Browse the repository at this point in the history
Try to guard against flashing channel settings page
  • Loading branch information
brianlovin authored Nov 25, 2019
2 parents f41f89a + f72c422 commit a90daea
Show file tree
Hide file tree
Showing 3 changed files with 342 additions and 169 deletions.
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@
"apollo-link-retry": "^2.2.15",
"apollo-link-schema": "^1.2.4",
"apollo-link-ws": "^1.0.19",
"apollo-server-cache-redis": "^1.1.3",
"apollo-server-express": "^2.9.3",
"apollo-server-plugin-response-cache": "^0.3.4",
"apollo-upload-client": "^9.1.0",
"apollo-server-cache-redis": "^1.1.4",
"apollo-server-express": "^2.9.12",
"apollo-server-plugin-response-cache": "^0.3.8",
"apollo-upload-client": "^11.0.0",
"apollo-upload-server": "^7.1.0",
"apollo-utilities": "^1.3.2",
"aws-sdk": "2.336.0",
Expand All @@ -82,7 +82,7 @@
"cors": "^2.8.3",
"cryptr": "^3.0.0",
"css.escape": "^1.5.1",
"cypress": "3.4.1",
"cypress": "^3.6.1",
"datadog-metrics": "^0.8.1",
"dataloader": "^1.4.0",
"debounce": "^1.2.0",
Expand Down Expand Up @@ -111,7 +111,7 @@
"express-session": "^1.15.2",
"faker": "^4.1.0",
"find-with-regex": "^1.0.2",
"flow-typed": "^2.5.1",
"flow-typed": "^2.6.2",
"graphql": "0.13.x",
"graphql-cost-analysis": "^1.0.2",
"graphql-date": "^1.0.3",
Expand Down
15 changes: 15 additions & 0 deletions src/views/channelSettings/components/channelMembers.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,21 @@ type Props = {
};

class ChannelMembers extends Component<Props> {
shouldComponentUpdate(nextProps: Props) {
const curr = this.props;
if (curr.data.channel && nextProps.data.channel && !curr.isFetchingMore) {
if (
curr.data.channel.memberConnection &&
nextProps.data.channel.memberConnection &&
curr.data.channel.memberConnection.edges.length ===
nextProps.data.channel.memberConnection.edges.length
) {
return false;
}
}
return true;
}

render() {
const {
data: { channel, fetchMore },
Expand Down
Loading

0 comments on commit a90daea

Please sign in to comment.