mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-30 12:39:20 +03:00
Prevent Circular dependencies
This commit is contained in:
parent
bb4ff4fdc7
commit
c270f0ad9a
10 changed files with 99 additions and 125 deletions
|
|
@ -687,16 +687,25 @@ class ComposePopupView extends AbstractViewPopup {
|
|||
|
||||
// getAutocomplete
|
||||
emailsSource(oData, fResponse) {
|
||||
Remote.suggestions((iError, data) => {
|
||||
if (!iError && isArray(data.Result)) {
|
||||
fResponse(
|
||||
data.Result.map(item => (item && item[0] ? (new EmailModel(item[0], item[1])).toLine(false) : null))
|
||||
.filter(v => v)
|
||||
);
|
||||
} else if (Notification.RequestAborted !== iError) {
|
||||
fResponse([]);
|
||||
}
|
||||
}, oData.term);
|
||||
Remote.request('Suggestions',
|
||||
(iError, data) => {
|
||||
if (!iError && isArray(data.Result)) {
|
||||
fResponse(
|
||||
data.Result.map(item => (item && item[0] ? (new EmailModel(item[0], item[1])).toLine(false) : null))
|
||||
.filter(v => v)
|
||||
);
|
||||
} else if (Notification.RequestAborted !== iError) {
|
||||
fResponse([]);
|
||||
}
|
||||
},
|
||||
{
|
||||
Query: oData.term
|
||||
// ,Page: 1
|
||||
},
|
||||
null,
|
||||
'',
|
||||
['Suggestions']
|
||||
);
|
||||
}
|
||||
|
||||
reloadDraftFolder() {
|
||||
|
|
|
|||
|
|
@ -490,7 +490,7 @@ export class MailMessageList extends AbstractViewRight {
|
|||
|
||||
message.flags.push('\\seen');
|
||||
// message.flags.valueHasMutated();
|
||||
uids.push(message.uid);
|
||||
iThreadUid && uids.push(message.uid);
|
||||
});
|
||||
|
||||
if (iThreadUid) {
|
||||
|
|
@ -501,7 +501,11 @@ export class MailMessageList extends AbstractViewRight {
|
|||
|
||||
MessageFlagsCache.clearFolder(sFolderFullName);
|
||||
|
||||
Remote.messageSetSeenToAll(sFolderFullName, true, iThreadUid ? uids : null);
|
||||
Remote.request('MessageSetSeenToAll', null, {
|
||||
Folder: sFolderFullName,
|
||||
SetAction: 1,
|
||||
ThreadUids: uids.join(',')
|
||||
});
|
||||
|
||||
MessagelistUserStore.reloadFlagsAndCachedMessage();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -522,16 +522,19 @@ export class MailMessageView extends AbstractViewRight {
|
|||
.map(item => (item && !item.isLinked() && item.checked() ? item.download : ''))
|
||||
.filter(v => v);
|
||||
if (hashes.length) {
|
||||
Remote.attachmentsActions('Zip', hashes, this.downloadAsZipLoading)
|
||||
.then(result => {
|
||||
let hash = result && result.Result && result.Result.FileHash;
|
||||
if (hash) {
|
||||
download(attachmentDownload(hash), hash+'.zip');
|
||||
} else {
|
||||
this.downloadAsZipError(true);
|
||||
}
|
||||
})
|
||||
.catch(() => this.downloadAsZipError(true));
|
||||
Remote.post('AttachmentsActions', this.downloadAsZipLoading, {
|
||||
Do: 'Zip',
|
||||
Hashes: hashes
|
||||
})
|
||||
.then(result => {
|
||||
let hash = result && result.Result && result.Result.FileHash;
|
||||
if (hash) {
|
||||
download(attachmentDownload(hash), hash+'.zip');
|
||||
} else {
|
||||
this.downloadAsZipError(true);
|
||||
}
|
||||
})
|
||||
.catch(() => this.downloadAsZipError(true));
|
||||
} else {
|
||||
this.highlightUnselectedAttachments(true);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue