Handle offline response for import

This commit is contained in:
Mo Bitar
2018-07-18 13:00:12 -05:00
parent f496101ad0
commit a1374b88ff
2 changed files with 4 additions and 2 deletions

View File

@@ -206,7 +206,8 @@ class AccountMenu {
// Update UI before showing alert
setTimeout(function () {
if(!response) {
// Response can be null if syncing offline
if(response && response.error) {
alert("There was an error importing your data. Please try again.");
} else {
if(errorCount > 0) {
@@ -257,6 +258,7 @@ class AccountMenu {
}
syncManager.sync({additionalFields: ["created_at", "updated_at"]}).then((response) => {
// Response can be null if syncing offline
callback(response, errorCount);
});
}