File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
src/internal-packages/crud/lib/component Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -69,6 +69,7 @@ class DocumentList extends React.Component {
69
69
*/
70
70
constructor ( props ) {
71
71
super ( props ) ;
72
+ this . loading = false ;
72
73
this . state = { docs : [ ] , nextSkip : 0 , namespace : NamespaceStore . ns } ;
73
74
}
74
75
@@ -86,6 +87,7 @@ class DocumentList extends React.Component {
86
87
nextSkip : ( this . state . nextSkip + documents . length ) ,
87
88
loadedCount : ( this . state . loadedCount + documents . length )
88
89
} ) ;
90
+ this . loading = false ;
89
91
}
90
92
91
93
/**
@@ -166,7 +168,8 @@ class DocumentList extends React.Component {
166
168
* in the collection to load.
167
169
*/
168
170
loadMore ( ) {
169
- if ( this . state . loadedCount < this . state . count ) {
171
+ if ( ! this . loading && ( this . state . loadedCount < this . state . count ) ) {
172
+ this . loading = true ;
170
173
Action . fetchNextDocuments ( this . state . nextSkip ) ;
171
174
}
172
175
}
You can’t perform that action at this time.
0 commit comments