Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove direct access to then #1116

Merged
merged 1 commit into from
May 21, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions addon/components/power-select.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ export default Component.extend({
if (options === oldOptions) {
return options;
}
if (options && options.then) {
if (options && get(options, 'then')) {
this.get('_updateOptionsTask').perform(options);
} else {
scheduleOnce('actions', this, this.updateOptions, options);
Expand Down Expand Up @@ -520,7 +520,7 @@ export default Component.extend({
let subOptions = get(entry, 'options');
let isGroup = !!get(entry, 'groupName') && !!subOptions;
if (isGroup) {
assert('ember-power-select doesn\'t support promises inside groups. Please, resolve those promises and turn them into arrays before passing them to ember-power-select', !subOptions.then);
assert('ember-power-select doesn\'t support promises inside groups. Please, resolve those promises and turn them into arrays before passing them to ember-power-select', !get(subOptions, 'then'));
walk(subOptions);
}
}
Expand Down Expand Up @@ -607,7 +607,7 @@ export default Component.extend({
let search = searchAction(term, publicAPI);
if (!search) {
publicAPI = this.updateState({ lastSearchedText: term });
} else if (search.then) {
} else if (get(search, 'then')) {
this.get('handleAsyncSearchTask').perform(term, search);
} else {
let resultsArray = toPlainArray(search);
Expand Down