diff --git a/app/assets/javascripts/app/directives/views/accountMenu.js b/app/assets/javascripts/app/directives/views/accountMenu.js index 2eccf5222..776b94658 100644 --- a/app/assets/javascripts/app/directives/views/accountMenu.js +++ b/app/assets/javascripts/app/directives/views/accountMenu.js @@ -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); }); } diff --git a/test/mocha/models.test.js b/test/mocha/models.test.js index bce424161..409079f75 100644 --- a/test/mocha/models.test.js +++ b/test/mocha/models.test.js @@ -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();