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 {
6969 */
7070 constructor ( props ) {
7171 super ( props ) ;
72+ this . loading = false ;
7273 this . state = { docs : [ ] , nextSkip : 0 , namespace : NamespaceStore . ns } ;
7374 }
7475
@@ -86,6 +87,7 @@ class DocumentList extends React.Component {
8687 nextSkip : ( this . state . nextSkip + documents . length ) ,
8788 loadedCount : ( this . state . loadedCount + documents . length )
8889 } ) ;
90+ this . loading = false ;
8991 }
9092
9193 /**
@@ -166,7 +168,8 @@ class DocumentList extends React.Component {
166168 * in the collection to load.
167169 */
168170 loadMore ( ) {
169- if ( this . state . loadedCount < this . state . count ) {
171+ if ( ! this . loading && ( this . state . loadedCount < this . state . count ) ) {
172+ this . loading = true ;
170173 Action . fetchNextDocuments ( this . state . nextSkip ) ;
171174 }
172175 }
You can’t perform that action at this time.
0 commit comments