File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 = ( ) => {
Original file line number Diff line number Diff line change 11import { getFormattedDate } from '../utils/date'
22
33const 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
119const date = ( state = initialState , action ) => {
Original file line number Diff line number Diff line change @@ -88,6 +88,7 @@ function* cleanPlays(payload) {
8888}
8989
9090export const gamesSagas = [
91+ takeLatest ( 'CHANGE_DATE' , getGames ) ,
9192 takeLatest ( 'GET_GAMES_REQUEST' , getGames ) ,
9293 takeLatest ( 'SELECT_GAME' , getGameStats )
9394]
You can’t perform that action at this time.
0 commit comments