mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-30 20:49:20 +03:00
Change handling of (token) errors due to #1706
This commit is contained in:
parent
02ea6c4359
commit
d00c953c88
25 changed files with 80 additions and 69 deletions
|
|
@ -36,7 +36,7 @@ export class AccountPopupView extends AbstractViewPopup {
|
|||
this.submitRequest(false);
|
||||
if (iError) {
|
||||
this.submitError(getNotification(iError));
|
||||
this.submitErrorAdditional(data?.ErrorMessageAdditional);
|
||||
this.submitErrorAdditional(data?.messageAdditional);
|
||||
} else {
|
||||
loadAccountsAndIdentities();
|
||||
this.close();
|
||||
|
|
|
|||
|
|
@ -499,8 +499,8 @@ export class ComposePopupView extends AbstractViewPopup {
|
|||
const sendFailed = (iError, data) => {
|
||||
this.sendError(true);
|
||||
this.sendErrorDesc(
|
||||
getNotification(iError, data?.ErrorMessage, Notifications.CantSendMessage)
|
||||
+ "\n" + (data?.ErrorMessageAdditional || data?.ErrorMessage)
|
||||
getNotification(iError, data?.message, Notifications.CantSendMessage)
|
||||
+ "\n" + (data?.messageAdditional || data?.message)
|
||||
);
|
||||
};
|
||||
try {
|
||||
|
|
@ -530,8 +530,8 @@ export class ComposePopupView extends AbstractViewPopup {
|
|||
if (Notifications.CantSaveMessage === iError) {
|
||||
this.sendSuccessButSaveError(true);
|
||||
let msg = i18n('COMPOSE/SAVED_ERROR_ON_SEND');
|
||||
if (data?.ErrorMessageAdditional) {
|
||||
msg = msg + "\n" + data?.ErrorMessageAdditional;
|
||||
if (data?.messageAdditional) {
|
||||
msg = msg + "\n" + data?.messageAdditional;
|
||||
}
|
||||
this.savedErrorDesc(msg);
|
||||
} else {
|
||||
|
|
@ -1151,7 +1151,7 @@ export class ComposePopupView extends AbstractViewPopup {
|
|||
.on('onComplete', (id, result, data) => {
|
||||
const attachment = this.getAttachmentById(id),
|
||||
response = data?.Result || {},
|
||||
errorCode = response.ErrorCode,
|
||||
errorCode = response.code,
|
||||
attachmentJson = result && response.Attachment;
|
||||
|
||||
let error = '';
|
||||
|
|
@ -1167,7 +1167,7 @@ export class ComposePopupView extends AbstractViewPopup {
|
|||
.waiting(false)
|
||||
.uploading(false)
|
||||
.complete(true)
|
||||
.error(error + '\n' + response.ErrorMessage);
|
||||
.error(error + '\n' + response.message);
|
||||
} else if (attachmentJson) {
|
||||
attachment
|
||||
.waiting(false)
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ export class ContactsPopupView extends AbstractViewPopup {
|
|||
Remote.request('ContactsDelete',
|
||||
(iError, oData) => {
|
||||
if (iError) {
|
||||
alert(oData?.ErrorMessage || getNotification(iError));
|
||||
alert(oData?.message || getNotification(iError));
|
||||
} else {
|
||||
const page = this.contactsPage();
|
||||
if (page > Math.max(1, Math.ceil((this.contactsCount() - count) / CONTACTS_PER_PAGE))) {
|
||||
|
|
@ -181,7 +181,7 @@ export class ContactsPopupView extends AbstractViewPopup {
|
|||
Remote.request('ContactSave',
|
||||
(iError, oData) => {
|
||||
if (iError) {
|
||||
alert(oData?.ErrorMessage || getNotification(iError));
|
||||
alert(oData?.message || getNotification(iError));
|
||||
} else if (oData.Result.ResultID) {
|
||||
if (contact.id()) {
|
||||
contact.id(oData.Result.ResultID);
|
||||
|
|
@ -245,7 +245,7 @@ export class ContactsPopupView extends AbstractViewPopup {
|
|||
|
||||
if (iError) {
|
||||
// console.error(data);
|
||||
alert(data?.ErrorMessage || getNotification(iError));
|
||||
alert(data?.message || getNotification(iError));
|
||||
} else if (arrayLength(data.Result.List)) {
|
||||
data.Result.List.forEach(item => {
|
||||
item = ContactModel.reviveFromJson(item);
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ export class IdentityPopupView extends AbstractViewPopup {
|
|||
identity.smimeKey(oData.Result.pkey);
|
||||
identity.smimeCertificate(oData.Result.x509);
|
||||
} else {
|
||||
this.submitError(oData.ErrorMessage);
|
||||
this.submitError(oData.message);
|
||||
}
|
||||
}, {
|
||||
name: identity.name(),
|
||||
|
|
@ -81,7 +81,7 @@ export class IdentityPopupView extends AbstractViewPopup {
|
|||
if (oData.Result) {
|
||||
identity.smimeKey(oData.Result);
|
||||
} else {
|
||||
this.submitError(oData.ErrorMessage);
|
||||
this.submitError(oData.message);
|
||||
}
|
||||
}, {
|
||||
privateKey: identity.smimeKey(),
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ export class OpenPgpImportPopupView extends AbstractViewPopup {
|
|||
const fn = () => Remote.request('PgpSearchKey',
|
||||
(iError, oData) => {
|
||||
if (iError) {
|
||||
this.key(oData.ErrorMessage);
|
||||
this.key(oData.message);
|
||||
} else {
|
||||
this.key(oData.Result);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,8 +29,8 @@ export class SMimeImportPopupView extends AbstractViewPopup {
|
|||
(iError, oData) => {
|
||||
if (iError) {
|
||||
this.pemError(true);
|
||||
this.pemErrorMessage(getNotification(iError, oData?.ErrorMessage));
|
||||
// oData?.ErrorMessageAdditional;
|
||||
this.pemErrorMessage(getNotification(iError, oData?.message));
|
||||
// oData?.messageAdditional;
|
||||
} else {
|
||||
this.close();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -118,9 +118,9 @@ export class LoginUserView extends AbstractViewLogin {
|
|||
if (Notifications.InvalidInputArgument == iError) {
|
||||
iError = Notifications.AuthError;
|
||||
}
|
||||
this.submitError(getNotification(iError, oData?.ErrorMessage,
|
||||
this.submitError(getNotification(iError, oData?.message,
|
||||
Notifications.UnknownError));
|
||||
this.submitErrorAdditional(oData?.ErrorMessageAdditional || oData?.message);
|
||||
this.submitErrorAdditional(oData?.messageAdditional || oData?.message);
|
||||
} else {
|
||||
rl.setData(oData.Result);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ export class SystemDropDownUserView extends AbstractViewRight {
|
|||
(iError/*, oData*/) => {
|
||||
if (iError) {
|
||||
AccountUserStore.loading(false);
|
||||
alert(getNotification(iError).replace('%EMAIL%', email));
|
||||
alert('Account error: ' + getNotification(iError).replace('%EMAIL%', email));
|
||||
if (account.isAdditional()) {
|
||||
showScreenPopup(AccountPopupView, [account]);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue