mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-08-03 08:21:07 +00:00
fix to editing profile: "TypeError: Cannot call method 'toString' of undefined"
This commit is contained in:
parent
fe52731393
commit
b23ce8426b
1 changed files with 3 additions and 1 deletions
|
|
@ -18,7 +18,9 @@ habitrpg.controller("UserCtrl", ['$rootScope', '$scope', '$location', 'User', '$
|
|||
var values = {};
|
||||
_.each($scope.editingProfile, function(value, key){
|
||||
// Using toString because we need to compare two arrays (websites)
|
||||
if($scope.editingProfile[key].toString() !== $scope.profile.profile[key].toString()) values['profile.' + key] = value;
|
||||
var curVal = $scope.profile.profile[key];
|
||||
if(!curVal || $scope.editingProfile[key].toString() !== curVal.toString())
|
||||
values['profile.' + key] = value;
|
||||
});
|
||||
User.setMultiple(values);
|
||||
$scope._editing.profile = false;
|
||||
|
|
|
|||
Loading…
Reference in a new issue