mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-03 22:47:03 +03:00
Reduce JavaScript footprint
This commit is contained in:
parent
689126c57d
commit
b12852bd08
42 changed files with 240 additions and 426 deletions
|
|
@ -50,20 +50,18 @@ export class UserSettingsAccounts /*extends AbstractViewSettings*/ {
|
|||
deleteAccount(accountToRemove) {
|
||||
if (accountToRemove?.askDelete()) {
|
||||
this.accountForDeletion(null);
|
||||
if (accountToRemove) {
|
||||
this.accounts.remove((account) => accountToRemove === account);
|
||||
this.accounts.remove(account => accountToRemove === account);
|
||||
|
||||
Remote.request('AccountDelete', (iError, data) => {
|
||||
if (!iError && data.Reload) {
|
||||
rl.route.root();
|
||||
setTimeout(() => location.reload(), 1);
|
||||
} else {
|
||||
rl.app.accountsAndIdentities();
|
||||
}
|
||||
}, {
|
||||
EmailToDelete: accountToRemove.email
|
||||
});
|
||||
}
|
||||
Remote.request('AccountDelete', (iError, data) => {
|
||||
if (!iError && data.Reload) {
|
||||
rl.route.root();
|
||||
setTimeout(() => location.reload(), 1);
|
||||
} else {
|
||||
rl.app.accountsAndIdentities();
|
||||
}
|
||||
}, {
|
||||
EmailToDelete: accountToRemove.email
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -74,13 +72,10 @@ export class UserSettingsAccounts /*extends AbstractViewSettings*/ {
|
|||
deleteIdentity(identityToRemove) {
|
||||
if (identityToRemove?.askDelete()) {
|
||||
this.identityForDeletion(null);
|
||||
|
||||
if (identityToRemove) {
|
||||
IdentityUserStore.remove(oIdentity => identityToRemove === oIdentity);
|
||||
Remote.request('IdentityDelete', () => rl.app.accountsAndIdentities(), {
|
||||
IdToDelete: identityToRemove.id()
|
||||
});
|
||||
}
|
||||
IdentityUserStore.remove(oIdentity => identityToRemove === oIdentity);
|
||||
Remote.request('IdentityDelete', () => rl.app.accountsAndIdentities(), {
|
||||
IdToDelete: identityToRemove.id()
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue