FIX: Do not query backend when searching "in this topic" (#14649)

This commit is contained in:
Penar Musaraj 2021-10-19 13:01:42 -04:00 committed by GitHub
parent 25097fa0af
commit a1daf9fe53
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

@ -428,7 +428,6 @@ export default createWidget("search-menu", {
triggerSearch() {
searchData.noResults = false;
if (SearchHelper.includesTopics()) {
if (this.state.inTopicContext) {
this.searchService().set("highlightTerm", searchData.term);
@ -438,7 +437,9 @@ export default createWidget("search-menu", {
SearchHelper.perform(this);
} else {
searchData.loading = false;
discourseDebounce(SearchHelper, SearchHelper.perform, this, 400);
if (!this.state.inTopicContext) {
discourseDebounce(SearchHelper, SearchHelper.perform, this, 400);
}
}
},

View File

@ -36,8 +36,9 @@ $search-pad-horizontal: 0.5em;
}
}
.btn {
.btn.search-context {
margin: 2px;
margin-right: 0;
}
&:focus-within {
@include default-focus;