21364: loadmore button now disables if it cant load more Arvados-DCO-1.1-Signed-off...
[arvados.git] / services / workbench2 / src / components / data-explorer / data-explorer.tsx
index 83a71ab509b65fa169c25325465d3b95f531715f..13ad46286c0071ed0f77140313313f101f5e3110 100644 (file)
@@ -169,6 +169,7 @@ export const DataExplorer = withStyles(styles)(
                 setCheckedListOnStore,
                 checkedList,
                 working,
+                page,
             } = this.props;
             return (
                 <Paper
@@ -319,7 +320,8 @@ export const DataExplorer = withStyles(styles)(
                                             onClick={this.loadMore}
                                             variant="contained"
                                             color="primary"  
-                                            style={{width: '100%', margin: '10px'}} 
+                                            style={{width: '100%', margin: '10px'}}
+                                            disabled={ working || (page + 1) * rowsPerPage >= itemsAvailable || (itemsAvailable === 0 && page === 0)}
                                         >
                                             Load more
                                         </Button>