Set response ErrorCode as iError for easier fetch error handling

This commit is contained in:
djmaze 2021-03-18 12:33:13 +01:00
parent a46c0c3b21
commit 11fd6736bb
24 changed files with 145 additions and 253 deletions

View file

@ -2,7 +2,6 @@ import ko from 'ko';
import {
SaveSettingsStep,
Notification,
Scope
} from 'Common/Enums';
@ -255,10 +254,8 @@ class ContactsPopupView extends AbstractViewPopup {
}
syncCommand() {
rl.app.contactsSync((iError, data) => {
if (iError || !data || !data.Result) {
alert(getNotification(data && data.ErrorCode ? data.ErrorCode : Notification.ContactsSyncError));
}
rl.app.contactsSync(iError => {
iError && alert(getNotification(iError));
this.reloadContactList(true);
});