mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-01 21:49:21 +03:00
Code refactoring (Q -> Promise)
This commit is contained in:
parent
7e4479d655
commit
1323a9ce52
10 changed files with 164 additions and 139 deletions
|
|
@ -409,7 +409,7 @@ class AppUser extends AbstractApp
|
|||
{
|
||||
callback(!!value);
|
||||
}
|
||||
}).fail(() => {
|
||||
}).catch(() => {
|
||||
if (callback)
|
||||
{
|
||||
_.delay(() => callback(false), 1);
|
||||
|
|
@ -423,7 +423,7 @@ class AppUser extends AbstractApp
|
|||
.abort('Folders')
|
||||
.fastResolve(true)
|
||||
.then(() => promise)
|
||||
.fail((errorCode) => {
|
||||
.catch((errorCode) => {
|
||||
FolderStore.folderList.error(Translator.getNotification(errorCode, '', errorDefCode));
|
||||
}).fin(() => {
|
||||
Promises.foldersReloadWithTimeout(FolderStore.foldersLoading);
|
||||
|
|
@ -453,14 +453,18 @@ class AppUser extends AbstractApp
|
|||
: (oItem.users && oItem.users[0] ? oItem.users[0].userId.userid : '')
|
||||
;
|
||||
|
||||
if (oItem.users) {
|
||||
if (oItem.users)
|
||||
{
|
||||
_.each(oItem.users, (item) => {
|
||||
oEmail.clear();
|
||||
oEmail.mailsoParse(item.userId.userid);
|
||||
if (oEmail.validate())
|
||||
if (item.userId)
|
||||
{
|
||||
aEmails.push(oEmail.email);
|
||||
aUsers.push(item.userId.userid);
|
||||
oEmail.clear();
|
||||
oEmail.mailsoParse(item.userId.userid);
|
||||
if (oEmail.validate())
|
||||
{
|
||||
aEmails.push(oEmail.email);
|
||||
aUsers.push(item.userId.userid);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue