File tree 3 files changed +5
-15
lines changed
3 files changed +5
-15
lines changed Original file line number Diff line number Diff line change @@ -21,14 +21,6 @@ class ScoresScreen extends Component<Props> {
21
21
}
22
22
}
23
23
24
- componentWillReceiveProps = ( props ) => {
25
- if ( props . date != this . state . date ) {
26
- this . setState ( {
27
- loading : true
28
- } )
29
- }
30
- }
31
-
32
24
componentDidMount = ( ) => {
33
25
this . fetchGames ( )
34
26
}
@@ -40,8 +32,7 @@ class ScoresScreen extends Component<Props> {
40
32
}
41
33
42
34
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 ;
45
36
}
46
37
47
38
fetchGames = ( ) => {
Original file line number Diff line number Diff line change 1
1
import { getFormattedDate } from '../utils/date'
2
2
3
3
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 ( )
9
7
}
10
8
11
9
const date = ( state = initialState , action ) => {
Original file line number Diff line number Diff line change @@ -88,6 +88,7 @@ function* cleanPlays(payload) {
88
88
}
89
89
90
90
export const gamesSagas = [
91
+ takeLatest ( 'CHANGE_DATE' , getGames ) ,
91
92
takeLatest ( 'GET_GAMES_REQUEST' , getGames ) ,
92
93
takeLatest ( 'SELECT_GAME' , getGameStats )
93
94
]
You can’t perform that action at this time.
0 commit comments