Skip to content

Commit 1714976

Browse files
author
Piotr Siatka
committed
WebTab: Fix missing results bug.
1 parent 05f9b99 commit 1714976

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/controls/filePicker/WebSearchTab/WebSearchTab.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,8 @@ export default class WebSearchTab extends React.Component<IWebSearchTabProps, IW
7272
{this.props.bingSearchService && this._renderSearchBox()}
7373
</div>
7474
<div className={styles.tab}>
75-
{!bingSearchService && strings.SorryWebSearch} {/* If we verified we don't have a key, give a little Sorry message */}
76-
{bingSearchService && !query && this._renderSearchSuggestions()} {/* No search yet, show suggestions */}
77-
{query && results && this._renderSearchResults()} {/* Got results, show them */}
75+
{ !query && this._renderSearchSuggestions() }
76+
{ query && results && this._renderSearchResults() }
7877
</div>
7978
<div className={styles.actionButtonsContainer}>
8079
{
@@ -283,8 +282,11 @@ export default class WebSearchTab extends React.Component<IWebSearchTabProps, IW
283282
};
284283
const searchResults = await this.props.bingSearchService.executeBingSearch(searchParams);
285284

286-
// Set the items so that the selection zone can keep track of them
287-
this._selection.setItems(searchResults, true);
285+
// If the results were obtained
286+
if (searchResults) {
287+
// Set the items so that the selection zone can keep track of them
288+
this._selection.setItems(searchResults, true);
289+
}
288290

289291
// Save results and stop loading indicator
290292
this.setState({

0 commit comments

Comments
 (0)