mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-25 06:48:01 -05:00
Wait for 2 characters before querying interest bar.
This commit is contained in:
@@ -2871,7 +2871,8 @@ class ApiController(RedditController, OAuth2ResourceController):
|
||||
if not g.CLOUDSEARCH_SEARCH_API:
|
||||
return []
|
||||
|
||||
if not query or not query.strip():
|
||||
query = query and query.strip()
|
||||
if not query or len(query) < 2:
|
||||
return []
|
||||
|
||||
exclude = Subreddit.default_subreddits()
|
||||
|
||||
@@ -29,7 +29,7 @@ r.ui.InterestBar.prototype = {
|
||||
}
|
||||
|
||||
this.queryChangedDebounced(query)
|
||||
if (query) {
|
||||
if (query && query.length > 1) {
|
||||
this.$el.addClass('working')
|
||||
} else {
|
||||
this.hideResults()
|
||||
@@ -38,7 +38,7 @@ r.ui.InterestBar.prototype = {
|
||||
},
|
||||
|
||||
queryChanged: function(query) {
|
||||
if (query) {
|
||||
if (query && query.length > 1) {
|
||||
$.ajax({
|
||||
url: '/api/subreddits_by_topic.json',
|
||||
data: {'query': query},
|
||||
|
||||
Reference in New Issue
Block a user