Fix `promise.then` inside `if`
This commit is contained in:
parent
16e46878ba
commit
b05af3dd44
|
@ -1499,7 +1499,8 @@ treemode._showAutoComplete = function (element) {
|
|||
self.autocomplete.hideDropDown();
|
||||
} else if (typeof result.then === 'function') {
|
||||
// probably a promise
|
||||
if (result.then(function (obj) {
|
||||
result
|
||||
.then(function (obj) {
|
||||
if (obj === null) {
|
||||
self.autocomplete.hideDropDown();
|
||||
} else if (obj.options) {
|
||||
|
@ -1507,7 +1508,10 @@ treemode._showAutoComplete = function (element) {
|
|||
} else {
|
||||
self.autocomplete.show(element, 0, obj);
|
||||
}
|
||||
}.bind(self)));
|
||||
})
|
||||
.catch(function (err) {
|
||||
console.error(err);
|
||||
});
|
||||
} else {
|
||||
// definitely not a promise
|
||||
if (result.options)
|
||||
|
|
Loading…
Reference in New Issue