fix: clear identity signature fields when emptied
This commit is contained in:
@@ -530,7 +530,7 @@ export class DemoJMAPClient implements IJMAPClient {
|
||||
async createIdentity(
|
||||
name: string, email: string,
|
||||
replyTo?: EmailAddress[] | null, bcc?: EmailAddress[] | null,
|
||||
htmlSignature?: string, textSignature?: string,
|
||||
textSignature?: string | null, htmlSignature?: string | null,
|
||||
): Promise<Identity> {
|
||||
const identity: Identity = {
|
||||
id: generateDemoId('identity'), name, email,
|
||||
@@ -542,9 +542,14 @@ export class DemoJMAPClient implements IJMAPClient {
|
||||
return identity;
|
||||
}
|
||||
|
||||
async updateIdentity(identityId: string, updates: { name?: string; replyTo?: EmailAddress[] | null; bcc?: EmailAddress[] | null; htmlSignature?: string; textSignature?: string }): Promise<void> {
|
||||
async updateIdentity(identityId: string, updates: { name?: string | null; replyTo?: EmailAddress[] | null; bcc?: EmailAddress[] | null; textSignature?: string | null; htmlSignature?: string | null }): Promise<void> {
|
||||
const identity = this.data.identities.find(i => i.id === identityId);
|
||||
if (identity) Object.assign(identity, updates);
|
||||
if (!identity) return;
|
||||
if (updates.name !== undefined) identity.name = updates.name ?? '';
|
||||
if (updates.replyTo !== undefined) identity.replyTo = updates.replyTo ?? undefined;
|
||||
if (updates.bcc !== undefined) identity.bcc = updates.bcc ?? undefined;
|
||||
if (updates.textSignature !== undefined) identity.textSignature = updates.textSignature ?? '';
|
||||
if (updates.htmlSignature !== undefined) identity.htmlSignature = updates.htmlSignature ?? '';
|
||||
}
|
||||
|
||||
async deleteIdentity(identityId: string): Promise<void> {
|
||||
|
||||
Reference in New Issue
Block a user