mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 12:09:20 +03:00
Composer changes for OpenPGP.js
This commit is contained in:
parent
e731343093
commit
3cc3a76b23
3 changed files with 92 additions and 47 deletions
|
|
@ -29,7 +29,13 @@ export class OpenPgpKeyModel extends AbstractModel {
|
|||
this.armor = armor;
|
||||
this.isPrivate = !!isPrivate;
|
||||
|
||||
this.selectUser(userID);
|
||||
if (this.users) {
|
||||
const index = this.users.indexOf(userID);
|
||||
if (-1 !== index) {
|
||||
this.user = this.users[index];
|
||||
this.email = this.emails[index];
|
||||
}
|
||||
}
|
||||
|
||||
this.deleteAccess = ko.observable(false);
|
||||
}
|
||||
|
|
@ -48,22 +54,4 @@ export class OpenPgpKeyModel extends AbstractModel {
|
|||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
select(pattern, property) {
|
||||
if (this[property]) {
|
||||
const index = this[property].indexOf(pattern);
|
||||
if (-1 !== index) {
|
||||
this.user = this.users[index];
|
||||
this.email = this.emails[index];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
selectUser(user) {
|
||||
this.select(user, 'users');
|
||||
}
|
||||
|
||||
selectEmail(email) {
|
||||
this.select(email, 'emails');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue