React router #343
|
@ -17,11 +17,16 @@ class ChannelClaimsDisplay extends React.Component {
|
|||
this.showNextResultsPage = this.showNextResultsPage.bind(this);
|
||||
}
|
||||
componentDidMount () {
|
||||
this.updateClaimsData(1);
|
||||
}
|
||||
updateClaimsData (page) {
|
||||
const name = this.props.name;
|
||||
const longId = this.props.longId;
|
||||
this.updateClaimsData(name, longId, 1);
|
||||
}
|
||||
componentWillReceiveProps (nextProps) {
|
||||
if (nextProps.name !== this.props.name || nextProps.longId !== this.props.longId) {
|
||||
this.updateClaimsData(nextProps.name, nextProps.longId, 1);
|
||||
}
|
||||
}
|
||||
updateClaimsData (name, longId, page) {
|
||||
const url = `/api/channel-claims/${name}/${longId}/${page}`;
|
||||
const that = this;
|
||||
return request(url)
|
||||
|
|
|
@ -17,6 +17,11 @@ class ShowChannel extends React.Component {
|
|||
See above re: previous request. I mostly fixed this, but not sure if more consolidation can be done. See above re: previous request. I mostly fixed this, but not sure if more consolidation can be done.
Same comments above about
Same comments above about `previousRequest`. I think a more understandable approach would just be:
```
if (!channel) this.props.onNewChannelRequest(...)
```
See above re: previous request. I mostly fixed this, but not sure if more consolidation can be done. See above re: previous request. I mostly fixed this, but not sure if more consolidation can be done.
|
||||
componentDidMount () {
|
||||
this.getAndStoreChannelData(this.props.requestName, this.props.requestId);
|
||||
}
|
||||
componentWillReceiveProps (nextProps) {
|
||||
Same comments above about
Same comments above about `previousRequest`. I think a more understandable approach would just be:
```
if (!channel) this.props.onNewChannelRequest(...)
```
See above re: previous request. I mostly fixed this, but not sure if more consolidation can be done. See above re: previous request. I mostly fixed this, but not sure if more consolidation can be done.
|
||||
if (nextProps.requestName !== this.props.requestName || nextProps.requestId !== this.props.requestId) {
|
||||
Same comments above about
Same comments above about `previousRequest`. I think a more understandable approach would just be:
```
if (!channel) this.props.onNewChannelRequest(...)
```
See above re: previous request. I mostly fixed this, but not sure if more consolidation can be done. See above re: previous request. I mostly fixed this, but not sure if more consolidation can be done.
|
||||
this.getAndStoreChannelData(nextProps.requestName, nextProps.requestId);
|
||||
Same comments above about
Same comments above about `previousRequest`. I think a more understandable approach would just be:
```
if (!channel) this.props.onNewChannelRequest(...)
```
See above re: previous request. I mostly fixed this, but not sure if more consolidation can be done. See above re: previous request. I mostly fixed this, but not sure if more consolidation can be done.
|
||||
}
|
||||
Same comments above about
Same comments above about `previousRequest`. I think a more understandable approach would just be:
```
if (!channel) this.props.onNewChannelRequest(...)
```
See above re: previous request. I mostly fixed this, but not sure if more consolidation can be done. See above re: previous request. I mostly fixed this, but not sure if more consolidation can be done.
|
||||
}
|
||||
Same comments above about
Same comments above about `previousRequest`. I think a more understandable approach would just be:
```
if (!channel) this.props.onNewChannelRequest(...)
```
See above re: previous request. I mostly fixed this, but not sure if more consolidation can be done. See above re: previous request. I mostly fixed this, but not sure if more consolidation can be done.
|
||||
getAndStoreChannelData (name, id) {
|
||||
if (!id) id = 'none';
|
||||
const url = `/api/channel-data/${name}/${id}`;
|
||||
|
@ -28,6 +33,7 @@ class ShowChannel extends React.Component {
|
|||
Same comments above about
Same comments above about `previousRequest`. I think a more understandable approach would just be:
```
if (!channel) this.props.onNewChannelRequest(...)
```
See above re: previous request. I mostly fixed this, but not sure if more consolidation can be done. See above re: previous request. I mostly fixed this, but not sure if more consolidation can be done.
Same comments above about
Same comments above about `previousRequest`. I think a more understandable approach would just be:
```
if (!channel) this.props.onNewChannelRequest(...)
```
See above re: previous request. I mostly fixed this, but not sure if more consolidation can be done. See above re: previous request. I mostly fixed this, but not sure if more consolidation can be done.
|
||||
return that.setState({error: message});
|
||||
}
|
||||
this.setState({
|
||||
error : null,
|
||||
Same comments above about
Same comments above about `previousRequest`. I think a more understandable approach would just be:
```
if (!channel) this.props.onNewChannelRequest(...)
```
See above re: previous request. I mostly fixed this, but not sure if more consolidation can be done. See above re: previous request. I mostly fixed this, but not sure if more consolidation can be done.
|
||||
name : data.channelName,
|
||||
longId : data.longChannelClaimId,
|
||||
shortId: data.shortChannelClaimId,
|
||||
|
|
|||
Same comments above about
Same comments above about `previousRequest`. I think a more understandable approach would just be:
```
if (!channel) this.props.onNewChannelRequest(...)
```
See above re: previous request. I mostly fixed this, but not sure if more consolidation can be done. See above re: previous request. I mostly fixed this, but not sure if more consolidation can be done.
Same comments above about
Same comments above about `previousRequest`. I think a more understandable approach would just be:
```
if (!channel) this.props.onNewChannelRequest(...)
```
See above re: previous request. I mostly fixed this, but not sure if more consolidation can be done. See above re: previous request. I mostly fixed this, but not sure if more consolidation can be done.
|
|
@ -23,8 +23,8 @@ class ShowPage extends React.Component {
|
|||
this.parseUrlAndUpdateState(identifier, claim);
|
||||
}
|
||||
componentWillReceiveProps (nextProps) {
|
||||
if (this.props.match.params !== nextProps.match.params) {
|
||||
console.log('received new params props');
|
||||
if (nextProps.match.params !== this.props.match.params) {
|
||||
console.log('ShowPage received new params props');
|
||||
const identifier = nextProps.match.params.identifier;
|
||||
const claim = nextProps.match.params.claim;
|
||||
this.parseUrlAndUpdateState(identifier, claim);
|
||||
|
|
Same comments above about
previousRequest
. I think a more understandable approach would just be: