1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-18 09:13:33 +00:00

premium check updates

This commit is contained in:
Kyle Spearrin
2017-07-26 10:07:12 -04:00
parent d4759d4056
commit a1dfd7493a
3 changed files with 28 additions and 25 deletions

View File

@@ -8,15 +8,16 @@
$scope.readOnly = true;
$scope.loading = true;
$scope.isPremium = true;
$scope.canUseAttachments = true;
var closing = false;
authService.getUserProfile().then(function (profile) {
$scope.isPremium = profile.premium;
});
apiService.logins.get({ id: loginId }, function (login) {
return apiService.logins.get({ id: loginId }).$promise;
}).then(function (login) {
$scope.login = cipherService.decryptLogin(login);
$scope.readOnly = !login.Edit;
$scope.canUseAttachments = $scope.isPremium || $scope.login.organizationId;
$scope.loading = false;
}, function () {
$scope.loading = false;
@@ -57,7 +58,7 @@
$scope.download = function (attachment) {
attachment.loading = true;
if (!$scope.login.organizationId && !$scope.isPremium) {
if (!$scope.canUseAttachments) {
attachment.loading = false;
alert('Premium membership is required to use this feature.');
return;