Remove from inflight cache before doing anything in done

This commit is contained in:
Bryan Housel
2018-07-12 23:56:03 -04:00
parent 57da729837
commit 775b47272d

View File

@@ -933,6 +933,8 @@ export default {
function done(err, xml) {
delete _noteCache.inflightPost[note.id];
if (err) {
// 400 Bad Request, 401 Unauthorized, 403 Forbidden..
if (err.status === 400 || err.status === 401 || err.status === 403) {
@@ -944,8 +946,6 @@ export default {
return callback({ message: 'Connection Switched', status: -1 });
}
delete _noteCache.inflightPost[note.id];
if (xml) { // we get the updated note back, remove from caches and reparse..
var item = { minX: note.loc[0], minY: note.loc[1], maxX: note.loc[0], maxY: note.loc[1], data: note };
_noteCache.rtree.remove(item, function isEql(a, b) { return a.data.id === b.data.id; });