Remove the email subscription requirement

This commit is contained in:
Girish Ramakrishnan
2018-06-11 10:30:02 -07:00
parent e741ca9216
commit af9652f7c8
2 changed files with 2 additions and 21 deletions

View File

@@ -2,7 +2,7 @@
/* global asyncForEach:false */
angular.module('Application').controller('EmailController', ['$scope', '$location', '$timeout', '$rootScope', 'Client', 'AppStore', function ($scope, $location, $timeout, $rootScope, Client, AppStore) {
angular.module('Application').controller('EmailController', ['$scope', '$location', '$timeout', '$rootScope', 'Client', function ($scope, $location, $timeout, $rootScope, Client) {
Client.onReady(function () { if (!Client.hasScope('mail')) $location.path('/'); });
$scope.ready = false;
@@ -10,7 +10,6 @@ angular.module('Application').controller('EmailController', ['$scope', '$locatio
$scope.client = Client;
$scope.user = Client.getUserInfo();
$scope.config = Client.getConfig();
$scope.hasSubscription = false;
$scope.domains = [];
$scope.users = [];
$scope.selectedDomain = null;
@@ -196,18 +195,7 @@ angular.module('Application').controller('EmailController', ['$scope', '$locatio
if ($scope.selectedDomain.mailConfig.enabled) {
$('#disableEmailModal').modal('show');
} else {
Client.getAppstoreConfig(function (error, appstoreConfig) {
if (error) return console.error(error);
if (!appstoreConfig.token) return;
AppStore.getSubscription(appstoreConfig, function (error, result) {
if (error) return console.error(error);
$scope.hasSubscription = result.plan.id !== 'free';
$('#enableEmailModal').modal('show');
});
});
$('#enableEmailModal').modal('show');
}
};