This repository was archived by the owner on May 16, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -25,8 +25,7 @@ module.exports = Backbone.View.extend({
2525 this . usersShort = new usersShortCollection ( this . model ) ;
2626 this . options . reverse && this . usersShort . models . reverse ( ) ;
2727 this . subViews = [ ] ;
28- this . showPerScroll = 10 ;
29- this . fetchMoreAfter = options . perFetch ;
28+ this . showPerScroll = 30 ;
3029 this . nextUserToShow = 0 ;
3130 this . fetchedUsers = this . usersShort . length ;
3231 this . totalUsers = this . options . followerCount ;
@@ -81,8 +80,7 @@ module.exports = Backbone.View.extend({
8180
8281 this . nextUserToShow = this . nextUserToShow >= this . fetchedUsers ? this . nextUserToShow : this . nextUserToShow + this . showPerScroll ;
8382
84- if ( this . fetchMoreAfter && end == this . fetchMoreAfter && this . fetchedUsers < this . totalUsers ) {
85- this . fetchMoreAfter = this . fetchMoreAfter + this . options . perFetch ;
83+ if ( this . fetchedUsers < this . totalUsers && this . $el . is ( ':visible' ) ) {
8684 this . trigger ( 'fetchMoreUsers' ) ;
8785 }
8886 } ,
Original file line number Diff line number Diff line change @@ -700,6 +700,13 @@ module.exports = baseVw.extend({
700700 //don't fetch again if all of the followers have been fetched
701701 return ;
702702 }
703+
704+ if ( this . fetchingFollowers ) {
705+ //don't cue up multiple calls
706+ return ;
707+ }
708+
709+ this . fetchingFollowers = true ;
703710
704711 if ( this . options . ownPage ) {
705712 fetchFollowersParameters = $ . param ( { 'start' : this . followerFetchStart } ) ;
@@ -727,6 +734,7 @@ module.exports = baseVw.extend({
727734 messageModal . show ( window . polyglot . t ( 'errorMessages.notFoundError' ) , window . polyglot . t ( 'Followers' ) ) ;
728735 } ,
729736 complete : function ( xhr , textStatus ) {
737+ self . fetchingFollowers = false ;
730738 if ( textStatus == 'parsererror' ) {
731739 messageModal . show ( window . polyglot . t ( 'errorMessages.serverError' ) , window . polyglot . t ( 'errorMessages.badJSON' ) ) ;
732740 throw new Error ( "The followers data returned from the API has a parsing error." ) ;
You can’t perform that action at this time.
0 commit comments