diff --git a/src/_locales/en/messages.json b/src/_locales/en/messages.json index 3e821ed2..25e172a6 100644 --- a/src/_locales/en/messages.json +++ b/src/_locales/en/messages.json @@ -838,5 +838,13 @@ "disableAutoTotpCopyDesc": { "message": "If your login has an authenticator key attached to it, the TOTP verification code is automatically copied to your clipboard whenever you auto-fill the login.", "description": "If your login has an authenticator key attached to it, the TOTP verification code is automatically copied to your clipboard whenever you auto-fill the login." + }, + "premiumRequired": { + "message": "Premium Required", + "description": "Premium Required" + }, + "premiumRequiredDesc": { + "message": "A premium membership is required to use this feature.", + "description": "A premium membership is required to use this feature." } } diff --git a/src/popup/app/vault/vaultViewLoginController.js b/src/popup/app/vault/vaultViewLoginController.js index 4ea4bdbf..6ce03342 100644 --- a/src/popup/app/vault/vaultViewLoginController.js +++ b/src/popup/app/vault/vaultViewLoginController.js @@ -2,7 +2,7 @@ angular .module('bit.vault') .controller('vaultViewLoginController', function ($scope, $state, $stateParams, loginService, toastr, $q, - $analytics, i18nService, utilsService, totpService, $timeout, tokenService, $window, cryptoService) { + $analytics, i18nService, utilsService, totpService, $timeout, tokenService, $window, cryptoService, SweetAlert) { $scope.i18n = i18nService; var from = $stateParams.from, totpInterval = null; @@ -105,6 +105,21 @@ angular }; $scope.download = function (attachment) { + if (!$scope.login.organizationId && !tokenService.getPremium()) { + SweetAlert.swal({ + title: i18nService.premiumRequired, + text: i18nService.premiumRequiredDesc, + showCancelButton: true, + confirmButtonText: i18nService.learnMore, + cancelButtonText: i18nService.cancel + }, function (confirmed) { + if (confirmed) { + chrome.tabs.create({ url: 'https://bitwarden.com' }); + } + }); + return; + } + if (attachment.downloading) { return; } diff --git a/src/popup/app/vault/views/vaultAttachments.html b/src/popup/app/vault/views/vaultAttachments.html index 848a88bf..effa1bf5 100644 --- a/src/popup/app/vault/views/vaultAttachments.html +++ b/src/popup/app/vault/views/vaultAttachments.html @@ -17,8 +17,7 @@ {{i18n.noAttachments}}
- {{attachment.fileName}} - + {{attachment.fileName}}