Show subscription dialog on app update

This commit is contained in:
Johannes Zellner
2017-06-06 13:14:50 +02:00
parent 32fa3b8a51
commit b7e3447a46
3 changed files with 18 additions and 9 deletions

View File

@@ -33,14 +33,18 @@ angular.module('Application').controller('MainController', ['$scope', '$route',
};
$scope.showUpdateModal = function (form) {
$scope.update.error.generic = null;
$scope.update.error.password = null;
$scope.update.password = '';
if ($scope.currentSubscription.plan && $scope.currentSubscription.plan.id === 'free') {
$('#setupSubscriptionModal').modal('show');
} else {
$scope.update.error.generic = null;
$scope.update.error.password = null;
$scope.update.password = '';
form.$setPristine();
form.$setUntouched();
form.$setPristine();
form.$setUntouched();
$('#updateModal').modal('show');
$('#updateModal').modal('show');
}
};
$scope.doUpdate = function () {