Fix for missing author when switching posts

No Issue
- Fixes the case where the authors dropdown in the
  post settings menu has no author selected after
  switching between posts.
This commit is contained in:
Jason Williams 2014-07-31 20:19:52 +00:00
parent 8acd3a5060
commit 27e14b7ad9

View File

@ -32,10 +32,17 @@ var PostSettingsMenuController = Ember.ObjectController.extend({
}.observes('selectedAuthor'),
authors: function () {
//Loaded asynchronously, so must use promise proxies.
var deferred = {};
var deferred = {},
self = this;
deferred.promise = this.store.find('user').then(function (users) {
return users.rejectBy('id', 'me');
}).then(function (users) {
self.set('selectedAuthor', users.get('firstObject'));
return users;
});
return Ember.ArrayProxy
.extend(Ember.PromiseProxyMixin)
.create(deferred);