From f9bd12eaa6938a65201785d8e4310526a96962f5 Mon Sep 17 00:00:00 2001 From: Steve Faulkner Date: Tue, 22 Jun 2021 15:21:58 -0500 Subject: [PATCH] Fix for QueryTab Load More (#907) --- src/Explorer/Controls/Editor/EditorReact.tsx | 6 +++ .../Tabs/QueryTab/QueryTabComponent.tsx | 37 ++++++------------- 2 files changed, 17 insertions(+), 26 deletions(-) diff --git a/src/Explorer/Controls/Editor/EditorReact.tsx b/src/Explorer/Controls/Editor/EditorReact.tsx index 662b78056..e97cf5da4 100644 --- a/src/Explorer/Controls/Editor/EditorReact.tsx +++ b/src/Explorer/Controls/Editor/EditorReact.tsx @@ -33,6 +33,12 @@ export class EditorReact extends React.Component { public queryEditorId: string; public executeQueryButton: Button; - public fetchNextPageButton: Button; public saveQueryButton: Button; public splitterId: string; public splitter: Splitter; @@ -195,23 +194,6 @@ export default class QueryTabComponent extends React.Component { - const allResultsMetadata = this.state.allResultsMetadata || []; - const numberOfResultsMetadata = allResultsMetadata.length; - - if (numberOfResultsMetadata === 0) { - return false; - } - - if (allResultsMetadata[numberOfResultsMetadata - 1].hasMoreResults) { - return true; - } - - return false; - })(), - visible: true, - }; this._buildCommandBarOptions(); props.onTabAccessor({ @@ -981,14 +963,17 @@ export default class QueryTabComponent extends React.Component {this.state.showingDocumentsDisplayText} - {this.fetchNextPageButton.enabled && |} - {this.fetchNextPageButton.enabled && ( - - - Load more - Fetch next page - - + {this.state.allResultsMetadata[this.state.allResultsMetadata.length - 1] + .hasMoreResults && ( + <> + | + + + Load more + Fetch next page + + + )} {this.state.queryResults &&