Skip to content

Commit

Permalink
Mitigate ordering dependency between Facets and SearchBar (#401)
Browse files Browse the repository at this point in the history
Facet retrieval isn't enabled until the Facets component is mounted and
initial search happens when the the SearchBar component is mounted,
creating an ordering dependency between the two components, if one
wishes for facets to be present for an initial search.

The location permissions check in
4afecdd mitigates this issue by
performing the search asynchronously; this commit makes the code path
also asynchronous in browsers that don't support the permissions API.
  • Loading branch information
data-enabler authored and vramesh1 committed Dec 14, 2019
1 parent f02064a commit 8291fb7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/ui/components/search/searchcomponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,10 @@ export default class SearchComponent extends Component {
}
});
} else {
this.search(q);
// Make sure both code paths are asynchrounous, for consistency
setTimeout(() => {
this.search(q);
});
}
});

Expand Down

0 comments on commit 8291fb7

Please sign in to comment.