mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-30 20:49:20 +03:00
Cleanup IdentityModel handling
This commit is contained in:
parent
bfffa750ca
commit
d495369688
5 changed files with 17 additions and 27 deletions
|
|
@ -1,7 +1,7 @@
|
|||
import 'External/User/ko';
|
||||
|
||||
import { SMAudio } from 'Common/Audio';
|
||||
import { isArray, pString, pInt } from 'Common/Utils';
|
||||
import { isArray, pInt } from 'Common/Utils';
|
||||
import { mailToHelper, setLayoutResizer, dropdownsDetectVisibility } from 'Common/UtilsUser';
|
||||
|
||||
import {
|
||||
|
|
@ -160,18 +160,7 @@ export class AppUser extends AbstractApp {
|
|||
|
||||
items = oData.Result.Identities;
|
||||
IdentityUserStore(isArray(items)
|
||||
? items.map(identityData => {
|
||||
const identity = new IdentityModel(
|
||||
pString(identityData.Id),
|
||||
pString(identityData.Email)
|
||||
);
|
||||
identity.name(pString(identityData.Name));
|
||||
identity.replyTo(pString(identityData.ReplyTo));
|
||||
identity.bcc(pString(identityData.Bcc));
|
||||
identity.signature(pString(identityData.Signature));
|
||||
identity.signatureInsertBefore(!!identityData.SignatureInsertBefore);
|
||||
return identity;
|
||||
})
|
||||
? items.map(identityData => IdentityModel.reviveFromJson(identityData))
|
||||
: []
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,12 +6,12 @@ export class IdentityModel extends AbstractModel {
|
|||
* @param {string} id
|
||||
* @param {string} email
|
||||
*/
|
||||
constructor(id, email) {
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
addObservablesTo(this, {
|
||||
id: id || '',
|
||||
email: email,
|
||||
id: '',
|
||||
email: '',
|
||||
name: '',
|
||||
|
||||
replyTo: '',
|
||||
|
|
|
|||
|
|
@ -63,7 +63,6 @@ export class IdentityPopupView extends AbstractViewPopup {
|
|||
const data = new FormData(form);
|
||||
data.set('Id', this.id);
|
||||
data.set('Signature', this.signature());
|
||||
data.set('SignatureInsertBefore', this.signatureInsertBefore() ? 1 : 0);
|
||||
Remote.request('IdentityUpdate', iError => {
|
||||
this.submitRequest(false);
|
||||
if (iError) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue