@ -25,10 +25,10 @@ const initialTimeline = ImmutableMap({
items : ImmutableList ( ) ,
items : ImmutableList ( ) ,
} ) ;
} ) ;
const expandNormalizedTimeline = ( state , timeline , statuses , next , isPartial ) => {
const expandNormalizedTimeline = ( state , timeline , statuses , next , isPartial , isLoadingRecent ) => {
return state . update ( timeline , initialTimeline , map => map . withMutations ( mMap => {
return state . update ( timeline , initialTimeline , map => map . withMutations ( mMap => {
mMap . set ( 'isLoading' , false ) ;
mMap . set ( 'isLoading' , false ) ;
if ( ! next ) mMap . set ( 'hasMore' , false ) ;
if ( ! next && ! isLoadingRecent ) mMap . set ( 'hasMore' , false ) ;
if ( ! statuses . isEmpty ( ) ) {
if ( ! statuses . isEmpty ( ) ) {
mMap . update ( 'items' , ImmutableList ( ) , oldIds => {
mMap . update ( 'items' , ImmutableList ( ) , oldIds => {
@ -116,7 +116,7 @@ export default function timelines(state = initialState, action) {
case TIMELINE _EXPAND _FAIL :
case TIMELINE _EXPAND _FAIL :
return state . update ( action . timeline , initialTimeline , map => map . set ( 'isLoading' , false ) ) ;
return state . update ( action . timeline , initialTimeline , map => map . set ( 'isLoading' , false ) ) ;
case TIMELINE _EXPAND _SUCCESS :
case TIMELINE _EXPAND _SUCCESS :
return expandNormalizedTimeline ( state , action . timeline , fromJS ( action . statuses ) , action . next , action . partial ) ;
return expandNormalizedTimeline ( state , action . timeline , fromJS ( action . statuses ) , action . next , action . partial , action . isLoadingRecent ) ;
case TIMELINE _UPDATE :
case TIMELINE _UPDATE :
return updateTimeline ( state , action . timeline , fromJS ( action . status ) ) ;
return updateTimeline ( state , action . timeline , fromJS ( action . status ) ) ;
case TIMELINE _DELETE :
case TIMELINE _DELETE :