mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-31 13:09:21 +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
|
|
@ -108,25 +108,21 @@
|
|||
|
||||
onChangePasswordResponse(iError, data) {
|
||||
this.reset(false);
|
||||
if (!iError && data && data.Result) {
|
||||
if (iError) {
|
||||
this.passwordUpdateError(true);
|
||||
if (131 === iError) {
|
||||
// Notification.CurrentPasswordIncorrect
|
||||
this.currentPasswordError(true);
|
||||
}
|
||||
this.errorDescription((data && data.ErrorMessageAdditional)
|
||||
|| rl.i18n('NOTIFICATIONS/COULD_NOT_SAVE_NEW_PASSWORD'));
|
||||
} else {
|
||||
this.currentPassword('');
|
||||
this.newPassword('');
|
||||
this.newPassword2('');
|
||||
this.passwordUpdateSuccess(true);
|
||||
rl.hash.set();
|
||||
rl.settings.set('AuthAccountHash', data.Result);
|
||||
} else {
|
||||
this.passwordUpdateError(true);
|
||||
this.errorDescription(rl.i18n('NOTIFICATIONS/COULD_NOT_SAVE_NEW_PASSWORD'));
|
||||
if (data) {
|
||||
if (131 === data.ErrorCode) {
|
||||
// Notification.CurrentPasswordIncorrect
|
||||
this.currentPasswordError(true);
|
||||
}
|
||||
if (data.ErrorMessageAdditional) {
|
||||
this.errorDescription(data.ErrorMessageAdditional);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,11 +22,11 @@
|
|||
|
||||
this.loading(true);
|
||||
|
||||
rl.pluginRemoteRequest(function (iError, oData) {
|
||||
rl.pluginRemoteRequest((iError, oData) => {
|
||||
|
||||
self.loading(false);
|
||||
|
||||
if (!iError && oData && oData.Result) {
|
||||
if (!iError) {
|
||||
self.php(oData.Result.PHP || '');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -33,11 +33,11 @@
|
|||
|
||||
this.saving(true);
|
||||
|
||||
rl.pluginRemoteRequest(function (iError, oData) {
|
||||
rl.pluginRemoteRequest((iError, oData) => {
|
||||
|
||||
self.saving(false);
|
||||
|
||||
if (!iError && oData && oData.Result)
|
||||
if (!iError)
|
||||
{
|
||||
// true
|
||||
}
|
||||
|
|
@ -61,11 +61,11 @@
|
|||
|
||||
this.loading(true);
|
||||
|
||||
rl.pluginRemoteRequest(function (iError, oData) {
|
||||
rl.pluginRemoteRequest((iError, oData) => {
|
||||
|
||||
self.loading(false);
|
||||
|
||||
if (!iError && oData && oData.Result)
|
||||
if (!iError)
|
||||
{
|
||||
self.userSkype(oData.Result.UserSkype || '');
|
||||
self.userFacebook(oData.Result.UserFacebook || '');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue