mirror of
https://github.com/bitwarden/browser
synced 2025-12-20 18:23:31 +00:00
fixes from refactors
This commit is contained in:
@@ -10,11 +10,11 @@ angular
|
||||
$scope.canAccessAttachments = $scope.isPremium;
|
||||
$scope.hasUpdatedKey = false;
|
||||
|
||||
cipherService.get($stateParams.id).then(function (login) {
|
||||
return login.decrypt();
|
||||
cipherService.get($stateParams.id).then(function (cipher) {
|
||||
return cipher.decrypt();
|
||||
}).then(function (model) {
|
||||
$scope.login = model;
|
||||
$scope.canAccessAttachments = $scope.isPremium || !!$scope.login.organizationId;
|
||||
$scope.cipher = model;
|
||||
$scope.canAccessAttachments = $scope.isPremium || !!$scope.cipher.organizationId;
|
||||
|
||||
if (!$scope.canAccessAttachments) {
|
||||
SweetAlert.swal({
|
||||
@@ -69,9 +69,9 @@ angular
|
||||
return deferred.promise;
|
||||
}
|
||||
|
||||
$scope.submitPromise = cipherService.saveAttachmentWithServer($scope.login, files[0]).then(function (login) {
|
||||
login.decrypt().then(function (model) {
|
||||
$scope.login = model;
|
||||
$scope.submitPromise = cipherService.saveAttachmentWithServer($scope.cipher, files[0]).then(function (cipher) {
|
||||
cipher.decrypt().then(function (model) {
|
||||
$scope.cipher = model;
|
||||
});
|
||||
$analytics.eventTrack('Added Attachment');
|
||||
toastr.success(i18nService.attachmentSaved);
|
||||
@@ -101,9 +101,9 @@ angular
|
||||
}, function (confirmed) {
|
||||
if (confirmed) {
|
||||
cipherService.deleteAttachmentWithServer($stateParams.id, attachment.id).then(function () {
|
||||
var index = $scope.login.attachments.indexOf(attachment);
|
||||
var index = $scope.cipher.attachments.indexOf(attachment);
|
||||
if (index > -1) {
|
||||
$scope.login.attachments.splice(index, 1);
|
||||
$scope.cipher.attachments.splice(index, 1);
|
||||
}
|
||||
$analytics.eventTrack('Deleted Attachment');
|
||||
toastr.success(i18nService.deletedAttachment);
|
||||
@@ -114,7 +114,7 @@ angular
|
||||
|
||||
$scope.close = function () {
|
||||
$state.go('editCipher', {
|
||||
loginId: $stateParams.id,
|
||||
cipherId: $stateParams.id,
|
||||
animation: 'out-slide-down',
|
||||
from: $stateParams.from,
|
||||
fromView: $stateParams.fromView
|
||||
|
||||
@@ -13,14 +13,16 @@
|
||||
<div class="list list-no-selection">
|
||||
<div class="list-section">
|
||||
<div class="list-section-items">
|
||||
<div class="list-section-item" ng-if="!login.attachments.length">
|
||||
<div class="list-section-item" ng-if="!cipher.attachments.length">
|
||||
{{i18n.noAttachments}}
|
||||
</div>
|
||||
<div class="list-section-item" ng-repeat="attachment in login.attachments">
|
||||
<span class="btn-list no-padding" stop-prop stop-click title="{{i18n.deleteAttachment}}"
|
||||
ng-click="delete(attachment)">
|
||||
<i class="fa fa-lg fa-trash"></i>
|
||||
</span>
|
||||
<div class="list-section-item" ng-repeat="attachment in cipher.attachments">
|
||||
<div class="action-buttons">
|
||||
<span class="btn-list no-padding" stop-prop stop-click title="{{i18n.deleteAttachment}}"
|
||||
ng-click="delete(attachment)">
|
||||
<i class="fa fa-lg fa-trash"></i>
|
||||
</span>
|
||||
</div>
|
||||
<small class="item-sub-label">{{attachment.sizeName}}</small>
|
||||
<span class="text">{{attachment.fileName}}</span>
|
||||
</div>
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
<span class="item-label">{{i18n.username}}</span>
|
||||
<span id="username">{{cipher.login.username}}</span>
|
||||
</div>
|
||||
<div class="list-section-item" ng-if="cipher.login.password">
|
||||
<div class="list-section-item wrap" ng-if="cipher.login.password">
|
||||
<div class="action-buttons">
|
||||
<a class="btn-list" href="" title="{{i18n.togglePassword}}" ng-click="togglePassword()">
|
||||
<i class="fa fa-lg" ng-class="[{'fa-eye': !showPassword}, {'fa-eye-slash': showPassword}]"></i>
|
||||
|
||||
Reference in New Issue
Block a user