diff --git a/webadmin/src/js/setup.js b/webadmin/src/js/setup.js index ef6dad1a2..bce39782f 100644 --- a/webadmin/src/js/setup.js +++ b/webadmin/src/js/setup.js @@ -185,11 +185,12 @@ app.controller('StepController', ['$scope', '$location', 'Wizard', function ($sc // ensure image got loaded before setting the preview avatar var image = document.createElement('img'); + var randomIndex = Math.floor(Math.random() * $scope.wizard.availableAvatars.length); image.onload = function() { - $scope.$apply(function () { $scope.wizard.setPreviewAvatar($scope.wizard.availableAvatars[0]); }); + $scope.$apply(function () { $scope.wizard.setPreviewAvatar($scope.wizard.availableAvatars[randomIndex]); }); image = null; }; - image.src = $scope.wizard.availableAvatars[0].data || $scope.wizard.availableAvatars[0].url; + image.src = $scope.wizard.availableAvatars[randomIndex].data || $scope.wizard.availableAvatars[randomIndex].url; }]); app.controller('FinishController', ['$scope', '$location', '$timeout', 'Wizard', 'Client', function ($scope, $location, $timeout, Wizard, Client) {