Handle offline response for import
This commit is contained in:
@@ -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);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user