mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-31 13:09:21 +03:00
Added: Password change plugin API improvements (#910)
This commit is contained in:
parent
b97bd4edf0
commit
cfad4bb005
11 changed files with 107 additions and 18 deletions
|
|
@ -233,11 +233,23 @@ class Translator
|
|||
return message;
|
||||
}
|
||||
|
||||
defCode = defCode ? (window.parseInt(defCode, 10)) || 0 : 0;
|
||||
return _.isUndefined(this.notificationI18N[code]) ? (
|
||||
defCode && _.isUndefined(this.notificationI18N[defCode]) ? this.notificationI18N[defCode] : ''
|
||||
) : this.notificationI18N[code];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {object} response
|
||||
* @param {number} defCode = Notification.UnknownNotification
|
||||
* @return {string}
|
||||
*/
|
||||
getNotificationFromResponse(response, defCode = Notification.UnknownNotification) {
|
||||
return response && response.ErrorCode ?
|
||||
this.getNotification(Utils.pInt(response.ErrorCode), response.ErrorMessage || '') :
|
||||
this.getNotification(defCode);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {*} code
|
||||
* @return {string}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue