0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-17 23:44:39 -05:00

Merge pull request #3490 from jaswilli/psm

Fix for missing author when switching posts
This commit is contained in:
Hannah Wolfe 2014-07-31 22:38:09 +01:00
commit 262169fcf8

View file

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