Send avatarType explicitly in profile

This commit is contained in:
Johannes Zellner
2024-01-29 13:35:54 +01:00
parent 35eb17a922
commit b03240ccb8
3 changed files with 15 additions and 9 deletions
+3 -8
View File
@@ -207,15 +207,10 @@ angular.module('Application').controller('ProfileController', ['$scope', '$trans
avatarChangeReset: function () {
$scope.avatarChange.error.avatar = null;
if ($scope.user.avatarUrl.indexOf('/api/v1/profile/avatar') !== -1) {
$scope.avatarChange.type = 'custom';
} else if ($scope.user.avatarUrl.indexOf('https://www.gravatar.com') === 0) {
$scope.avatarChange.type = 'gravatar';
} else {
$scope.avatarChange.type = '';
}
console.log($scope.user)
$scope.avatarChange.type = $scope.user.avatarType;
$scope.avatarChange.typeOrig = $scope.avatarChange.type;
document.getElementById('previewAvatar').src = $scope.avatarChange.type === 'custom' ? $scope.user.avatarUrl : '';
$scope.avatarChange.pictureChanged = false;
$scope.avatarChange.avatar = null;