0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-06 22:40:14 -05:00

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 c5fbe2def3
commit fc88f53bae

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);