From 27e14b7ad92daa25bb3adf1dd3899732b5690fff Mon Sep 17 00:00:00 2001 From: Jason Williams Date: Thu, 31 Jul 2014 20:19:52 +0000 Subject: [PATCH] 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. --- ghost/admin/controllers/post-settings-menu.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ghost/admin/controllers/post-settings-menu.js b/ghost/admin/controllers/post-settings-menu.js index 71efc8641d..3829c6e9c4 100644 --- a/ghost/admin/controllers/post-settings-menu.js +++ b/ghost/admin/controllers/post-settings-menu.js @@ -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);