Merge branch 'local' into develop
Showing
1 changed file
with
3 additions
and
2 deletions
@@ -73,12 +73,13 @@ export default function userReducer(state = initialState, action) { | @@ -73,12 +73,13 @@ export default function userReducer(state = initialState, action) { | ||
73 | } | 73 | } |
74 | 74 | ||
75 | case HOME_BRABDRANK_SUCCESS: { | 75 | case HOME_BRABDRANK_SUCCESS: { |
76 | - let rise = Math.abs(action.payload.rankChange) == action.payload.rankChange ? true : false; | 76 | + let rankChange = action.payload.rankChange || 0; |
77 | + let rise = Math.abs(rankChange) == rankChange ? true : false; | ||
77 | let nextState = state.set('isFetching', false) | 78 | let nextState = state.set('isFetching', false) |
78 | .set('error', null) | 79 | .set('error', null) |
79 | .setIn(['overview', 'rank'], action.payload.rankNow || 0) | 80 | .setIn(['overview', 'rank'], action.payload.rankNow || 0) |
80 | .setIn(['overview', 'rise'], rise) | 81 | .setIn(['overview', 'rise'], rise) |
81 | - .setIn(['overview', 'riseCount'], Math.abs(action.payload.rankChange)) | 82 | + .setIn(['overview', 'riseCount'], Math.abs(rankChange)) |
82 | return nextState; | 83 | return nextState; |
83 | } | 84 | } |
84 | 85 |
-
Please register or login to post a comment