Fix get or set history on server ajax should not fallback to browser storage to avoid some internet edge cases

This commit is contained in:
Wu Cheng-Han 2016-10-10 20:50:01 +08:00
parent b6e68b2d36
commit dc343978eb

View file

@ -165,8 +165,8 @@ function writeHistoryToServer(view) {
var newnotehistory = generateHistory(view, notehistory);
saveHistoryToServer(newnotehistory);
})
.fail(function () {
writeHistoryToStorage(view);
.fail(function (xhr, status, error) {
console.error(xhr.responseText);
});
}
@ -286,8 +286,8 @@ function getServerHistory(callback) {
callback(data.history);
}
})
.fail(function () {
getStorageHistory(callback);
.fail(function (xhr, status, error) {
console.error(xhr.responseText);
});
}
@ -327,8 +327,8 @@ function parseServerToHistory(list, callback) {
parseToHistory(list, data.history, callback);
}
})
.fail(function () {
parseStorageToHistory(list, callback);
.fail(function (xhr, status, error) {
console.error(xhr.responseText);
});
}