Skip to content

Commit

Permalink
Fixed bug with loading default user preferences if user doesn't yet h…
Browse files Browse the repository at this point in the history
…ave any preferenced
  • Loading branch information
Phil committed Feb 4, 2014
1 parent b7df551 commit 7bde365
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/components/models/userProfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ baw.UserProfile = (function () {
if (!defaultProfile) {
throw new Error("A default profile must be supplied");
}



profile.preferences = profile.preferences || {};


// make read only properties for all profile props returned
var props = Object.keys(profile)
.reduce(function (state, current, index, array) {
Expand All @@ -37,7 +41,7 @@ baw.UserProfile = (function () {
if (!merged.hasOwnProperty(key)) {
return;
}

this.preferences[key] = merged[key];
}
}
Expand Down

0 comments on commit 7bde365

Please sign in to comment.