1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-17 00:33:44 +00:00

premium required messages

This commit is contained in:
Kyle Spearrin
2017-07-06 16:15:28 -04:00
parent 8df16f28e7
commit dfd791ecf9
9 changed files with 119 additions and 30 deletions

View File

@@ -200,22 +200,35 @@
};
$scope.attachments = function (login) {
if (!cryptoService.getEncKey()) {
toastr.error('You cannot use this feature until you update your encryption key.', 'Feature Unavailable');
return;
}
var addModel = $uibModal.open({
animation: true,
templateUrl: 'app/vault/views/vaultAttachments.html',
controller: 'vaultAttachmentsController',
resolve: {
loginId: function () { return login.id; }
authService.getUserProfile().then(function (profile) {
return profile.premium;
}).then(function (isPremium) {
if (!isPremium) {
$uibModal.open({
animation: true,
templateUrl: 'app/views/premiumRequired.html',
controller: 'premiumRequiredController'
});
return;
}
});
addModel.result.then(function (data) {
if (!cryptoService.getEncKey()) {
toastr.error('You cannot use this feature until you update your encryption key.', 'Feature Unavailable');
return;
}
var addModel = $uibModal.open({
animation: true,
templateUrl: 'app/vault/views/vaultAttachments.html',
controller: 'vaultAttachmentsController',
resolve: {
loginId: function () { return login.id; }
}
});
addModel.result.then(function (data) {
});
});
};