Skip to content

Commit

Permalink
Fix default user cover on settings pane
Browse files Browse the repository at this point in the history
Closes #2806
- Ensures that the user's cover property is a string, otherwise uses the
  default cover.
  • Loading branch information
novaugust committed May 24, 2014
1 parent 51090ac commit b4d2f66
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions core/client/controllers/settings/user.js
@@ -1,10 +1,14 @@
/*global alert */

var SettingsUserController = Ember.Controller.extend({
coverDefault: '/shared/img/user-cover.png',
cover: function () {
// @TODO: add {{asset}} subdir path
return this.user.getWithDefault('cover', '/shared/img/user-cover.png');
}.property('user.cover'),
var cover = this.user.get('cover');
if (typeof cover !== 'string') {
cover = this.get('coverDefault');
}
return cover;
}.property('user.cover', 'coverDefault'),

coverTitle: function () {
return this.get('user.name') + '\'s Cover Image';
Expand Down

0 comments on commit b4d2f66

Please sign in to comment.