mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-30 03:39:36 +02:00
Post save delay before fetching new data to allow for postgres replication
re: #2678 #2667 #1646 I cheated a bit by putting half the delay before showing success pane and half after.
This commit is contained in:
@@ -265,9 +265,9 @@ iD.Connection = function() {
|
||||
}, function(err) {
|
||||
if (err) return callback(err);
|
||||
// POST was successful, safe to call the callback.
|
||||
// Still attempt to close changeset, but ignore response.
|
||||
// see #2667
|
||||
callback(null, changeset_id);
|
||||
// Still attempt to close changeset, but ignore response because #2667
|
||||
// Add delay to allow for postgres replication #1646 #2678
|
||||
window.setTimeout(function() { callback(null, changeset_id); }, 2500);
|
||||
oauth.xhr({
|
||||
method: 'PUT',
|
||||
path: '/api/0.6/changeset/' + changeset_id + '/close'
|
||||
|
||||
@@ -37,7 +37,7 @@ iD.modes.Browse = function(context) {
|
||||
});
|
||||
|
||||
if (sidebar) {
|
||||
context.ui().sidebar.hide(sidebar);
|
||||
context.ui().sidebar.hide();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
+8
-5
@@ -165,9 +165,12 @@ iD.modes.Save = function(context) {
|
||||
});
|
||||
showErrors();
|
||||
} else {
|
||||
loading.close();
|
||||
context.flush();
|
||||
success(e, changeset_id);
|
||||
// Add delay to allow for postgres replication #1646 #2678
|
||||
window.setTimeout(function() {
|
||||
loading.close();
|
||||
context.flush();
|
||||
}, 2500);
|
||||
}
|
||||
});
|
||||
} else { // changes were insignificant or reverted by user
|
||||
@@ -293,8 +296,8 @@ iD.modes.Save = function(context) {
|
||||
id: changeset_id,
|
||||
comment: e.comment
|
||||
})
|
||||
.on('cancel', function(ui) {
|
||||
context.ui().sidebar.hide(ui);
|
||||
.on('cancel', function() {
|
||||
context.ui().sidebar.hide();
|
||||
})));
|
||||
}
|
||||
|
||||
@@ -309,7 +312,7 @@ iD.modes.Save = function(context) {
|
||||
};
|
||||
|
||||
mode.exit = function() {
|
||||
context.ui().sidebar.hide(ui);
|
||||
context.ui().sidebar.hide();
|
||||
};
|
||||
|
||||
return mode;
|
||||
|
||||
Reference in New Issue
Block a user