Move subscription setup outlink button inside iframe for better label control

This commit is contained in:
Johannes Zellner
2019-08-14 15:48:10 +02:00
parent d6eb6d3318
commit 2287a550d7
2 changed files with 5 additions and 10 deletions

View File

@@ -43,10 +43,8 @@ angular.module('Application').controller('MainController', ['$scope', '$route',
});
});
$scope.waitForPlanSelection = function () {
if ($scope.waitingForPlanSelection) return;
$scope.waitingForPlanSelection = true;
$scope.showSubscriptionModal = function () {
$('#setupSubscriptionModal').modal('show');
function checkPlan() {
if (!$scope.waitingForPlanSelection) return;
@@ -55,7 +53,7 @@ angular.module('Application').controller('MainController', ['$scope', '$route',
if (error) return console.error(error);
// check again to give more immediate feedback once a subscription was setup
if (subscription.plan.id === 'free') {
if (subscription.plan.id === 'free' || subscription.plan.id === 'expired') {
$timeout(checkPlan, 5000);
} else {
$scope.waitingForPlanSelection = false;
@@ -65,11 +63,9 @@ angular.module('Application').controller('MainController', ['$scope', '$route',
});
}
checkPlan();
};
$scope.waitingForPlanSelection = true;
$scope.showSubscriptionModal = function () {
$('#setupSubscriptionModal').modal('show');
checkPlan();
};
function refreshNotifications() {