{message}
: '';
+ if (type === 'spinnyCentered') {
+ return (
+
+ {this.renderBusySymbol()}
+
+
+ {messageToShow}
+
+ );
+ }
+
+ const containerStyle = {
+ display: 'flex',
+ flexFlow: 'row nowrap',
+ alignItems: 'center',
+ ...style,
+ };
+
const leftContents = validRightPosition
? this.renderBusySymbol()
: messageToShow;
@@ -175,3 +217,5 @@ export default class BusyIndicator extends React.Component {
- this.updateSearchResults(response, error);
-
- // potentially do window.scrollTo(0, 0)?
- // Update the URL if needed.
- const oldQueryString = this.props.location.query;
- const updatedQueryString = this.generateLocationQueryStringFromState(this.state, oldQueryString);
- if (oldQueryString !== updatedQueryString) {
- this.props.history.push(`?${updatedQueryString}`);
- }
- });
+ if (!this.state.isSearching) {
+ this.setState({ isSearching: true }, () => {
+ this.search.search(qr, (response: QueryResponse | null, error: string | null) => {
+ this.setState({ isSearching: false }, () => {
+ this.updateSearchResults(response, error);
+
+ // potentially do window.scrollTo(0, 0)?
+
+ // Update the URL if needed.
+ const oldQueryString = this.props.location.query;
+ const updatedQueryString = this.generateLocationQueryStringFromState(this.state, oldQueryString);
+ if (oldQueryString !== updatedQueryString) {
+ this.props.history.push(`?${updatedQueryString}`);
+ }
+ this.updateSearchResults(response, error);
+ });
+ });
+ });
+ }
}
/**
@@ -899,7 +917,6 @@ class Searcher extends React.Component