On error, reset the busy flag

this happens when icon is too large, for example
This commit is contained in:
Girish Ramakrishnan
2019-10-11 15:18:48 -07:00
parent 36028632ac
commit bf454816ea

View File

@@ -144,7 +144,9 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
$scope.display.busy = true;
$scope.display.error = {};
function done() {
function done(error) {
if (error) Client.error(error);
refreshApp($scope.display.show);
$timeout(function () {
@@ -158,14 +160,14 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
var configureLabel = $scope.display.label === $scope.app.label ? NOOP : Client.configureApp.bind(null, $scope.app.id, 'label', { label: $scope.display.label });
configureLabel(function (error) {
if (error) return Client.error(error);
if (error) return done(error);
var tags = $scope.display.tags.split(',').map(function (t) { return t.trim(); }).filter(function (t) { return !!t; });
var configureTags = angular.equals(tags, $scope.app.tags) ? NOOP : Client.configureApp.bind(null, $scope.app.id, 'tags', { tags: tags });
configureTags(function (error) {
if (error) return Client.error(error);
if (error) return done(error);
// skip if icon is unchanged
if ($scope.display.icon.data === null) return done();
@@ -178,7 +180,7 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
}
Client.configureApp($scope.app.id, 'icon', { icon: icon }, function (error) {
if (error) return Client.error(error);
if (error) return done(error);
done();
});
});