mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-04 15:07:02 +03:00
Set response ErrorCode as iError for easier fetch error handling
This commit is contained in:
parent
a46c0c3b21
commit
11fd6736bb
24 changed files with 145 additions and 253 deletions
|
|
@ -579,28 +579,21 @@ class ComposePopupView extends AbstractViewPopup {
|
|||
}
|
||||
|
||||
sendMessageResponse(iError, data) {
|
||||
let result = false,
|
||||
message = '';
|
||||
|
||||
this.sending(false);
|
||||
|
||||
if (!iError && data && data.Result) {
|
||||
result = true;
|
||||
this.modalVisibility() && this.closeCommand && this.closeCommand();
|
||||
}
|
||||
|
||||
if (this.modalVisibility() && !result) {
|
||||
if (data && Notification.CantSaveMessage === data.ErrorCode) {
|
||||
this.sendSuccessButSaveError(true);
|
||||
this.savedErrorDesc(i18n('COMPOSE/SAVED_ERROR_ON_SEND').trim());
|
||||
if (this.modalVisibility()) {
|
||||
if (iError) {
|
||||
if (Notification.CantSaveMessage === iError) {
|
||||
this.sendSuccessButSaveError(true);
|
||||
this.savedErrorDesc(i18n('COMPOSE/SAVED_ERROR_ON_SEND').trim());
|
||||
} else {
|
||||
this.sendError(true);
|
||||
this.sendErrorDesc(getNotification(iError, data && data.ErrorMessage)
|
||||
|| getNotification(Notification.CantSendMessage));
|
||||
}
|
||||
} else {
|
||||
message = getNotification(
|
||||
data && data.ErrorCode ? data.ErrorCode : Notification.CantSendMessage,
|
||||
data && data.ErrorMessage ? data.ErrorMessage : ''
|
||||
);
|
||||
|
||||
this.sendError(true);
|
||||
this.sendErrorDesc(message || getNotification(Notification.CantSendMessage));
|
||||
this.closeCommand && this.closeCommand();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue