mirror of
https://github.com/bitwarden/browser.git
synced 2024-12-28 17:27:50 +01:00
share promises and readonly check
This commit is contained in:
parent
5e5e3b5359
commit
f80ba6b87c
@ -7,12 +7,22 @@
|
||||
$scope.login = {};
|
||||
$scope.subvaults = [];
|
||||
$scope.organizations = [];
|
||||
$scope.readOnly = false;
|
||||
|
||||
apiService.logins.get({ id: loginId }, function (login) {
|
||||
$scope.login = cipherService.decryptLogin(login);
|
||||
});
|
||||
apiService.logins.get({ id: loginId }).$promise.then(function (login) {
|
||||
$scope.readOnly = !login.Edit;
|
||||
if (login.Edit) {
|
||||
$scope.login = cipherService.decryptLogin(login);
|
||||
}
|
||||
|
||||
authService.getUserProfile().then(function (profile) {
|
||||
return login.Edit;
|
||||
}).then(function (canEdit) {
|
||||
if (!canEdit) {
|
||||
return;
|
||||
}
|
||||
|
||||
return authService.getUserProfile();
|
||||
}).then(function (profile) {
|
||||
if (profile && profile.organizations) {
|
||||
var orgs = [];
|
||||
for (var i = 0; i < profile.organizations.length; i++) {
|
||||
|
Loading…
Reference in New Issue
Block a user