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);
});
}

View File

@@ -49,7 +49,7 @@ describe("notes and tags", () => {
expect(note).to.be.an.instanceOf(SNNote);
});
it.only('properly handles legacy relationships', () => {
it('properly handles legacy relationships', () => {
// legacy relationships are when a note has a reference to a tag
let modelManager = Factory.createModelManager();
let pair = createRelatedNoteTagPair();