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