Skip to content

Commit

Permalink
Fix Add Widget always shows recent queries list (#4658)
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrieldutra authored Feb 18, 2020
1 parent 7ff5af1 commit 2833bb5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions client/app/components/QuerySelector.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ import useSearchResults from "@/lib/hooks/useSearchResults";

const { Option } = Select;
function search(term) {
if (term === null) {
return Promise.resolve(null);
}

// get recent
if (!term) {
return Query.recent().then(results => results.filter(item => !item.is_draft)); // filter out draft
Expand Down

0 comments on commit 2833bb5

Please sign in to comment.