Skip to content

Commit 14f9cfb

Browse files
committed
bump season, fix bug where loader didn't go away
1 parent 4e121c4 commit 14f9cfb

File tree

3 files changed

+5
-15
lines changed

3 files changed

+5
-15
lines changed

App/components/ScoresScreen/ScoresScreen.js

+1-10
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,6 @@ class ScoresScreen extends Component<Props> {
2121
}
2222
}
2323

24-
componentWillReceiveProps = (props) => {
25-
if (props.date != this.state.date) {
26-
this.setState({
27-
loading: true
28-
})
29-
}
30-
}
31-
3224
componentDidMount = () => {
3325
this.fetchGames()
3426
}
@@ -40,8 +32,7 @@ class ScoresScreen extends Component<Props> {
4032
}
4133

4234
shouldComponentUpdate = (nextProps, nextState) => {
43-
if (this.props.games.length === 0 && nextProps.games.length > 0) { return true };
44-
return this.state.date != nextProps.date || this.state.refresh
35+
return this.props.games !== nextProps.games;
4536
}
4637

4738
fetchGames = () => {

App/reducers/date.reducers.js

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
import { getFormattedDate } from '../utils/date'
22

33
const initialState = {
4-
season: 2017,
5-
// currentDate: getFormattedDate(),
6-
// date: getFormattedDate()
7-
currentDate: '4/3/2018',
8-
date: '4/3/2018'
4+
season: 2018,
5+
currentDate: getFormattedDate(),
6+
date: getFormattedDate()
97
}
108

119
const date = (state = initialState, action) => {

App/sagas/games.sagas.js

+1
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ function* cleanPlays(payload) {
8888
}
8989

9090
export const gamesSagas = [
91+
takeLatest('CHANGE_DATE', getGames),
9192
takeLatest('GET_GAMES_REQUEST', getGames),
9293
takeLatest('SELECT_GAME', getGameStats)
9394
]

0 commit comments

Comments
 (0)