mirror of
https://github.com/discourse/discourse.git
synced 2025-03-09 14:34:35 +00:00
Fix broken JS specs.
This commit is contained in:
parent
fc4fde453d
commit
0042d94f76
@ -66,7 +66,7 @@ const SearchHelper = {
|
|||||||
|
|
||||||
searchData.results = content;
|
searchData.results = content;
|
||||||
|
|
||||||
if (searchContext.type === 'topic') {
|
if (searchContext && searchContext.type === 'topic') {
|
||||||
widget.appEvents.trigger('post-stream:refresh', { force: true });
|
widget.appEvents.trigger('post-stream:refresh', { force: true });
|
||||||
searchData.topicId = searchContext.id;
|
searchData.topicId = searchContext.id;
|
||||||
}
|
}
|
||||||
@ -170,10 +170,15 @@ export default createWidget('search-menu', {
|
|||||||
|
|
||||||
html(attrs) {
|
html(attrs) {
|
||||||
searchData.contextEnabled = attrs.contextEnabled;
|
searchData.contextEnabled = attrs.contextEnabled;
|
||||||
|
const searchContext = this.searchContext();
|
||||||
|
|
||||||
const shouldTriggerSearch = (
|
const shouldTriggerSearch = (
|
||||||
(searchData.contextEnabled !== attrs.contextEnabled) ||
|
(searchData.contextEnabled !== attrs.contextEnabled) ||
|
||||||
(this.searchContext().type === 'topic' && searchData.topicId !== this.searchContext().id)
|
(searchContext &&
|
||||||
|
searchContext.type === 'topic' &&
|
||||||
|
searchData.topicId !== null &&
|
||||||
|
searchData.topicId !== searchContext.id
|
||||||
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (shouldTriggerSearch && searchData.term) {
|
if (shouldTriggerSearch && searchData.term) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user