mirror of https://github.com/zulip/zulip.git
typeahead: Simplify call to `this.source`.
`this.source` will always be of type `function`, so we can remove the ternary statement. And `source` always takes one argument, so we can remove the second argument.
This commit is contained in:
parent
954da81f4c
commit
6aee4f270e
|
@ -303,10 +303,7 @@ Typeahead.prototype = {
|
|||
return this.shown ? this.hide() : this;
|
||||
}
|
||||
|
||||
const items =
|
||||
typeof this.source === "function"
|
||||
? this.source(this.query, this.process.bind(this))
|
||||
: this.source;
|
||||
const items = this.source(this.query);
|
||||
|
||||
if (!items && this.shown) {
|
||||
this.hide();
|
||||
|
|
Loading…
Reference in New Issue