Skip to content

Commit

Permalink
Don't display error messages when second scheduled rc command fails
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonKhorev committed Oct 26, 2022
1 parent f407def commit 8482a2d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions app/assets/javascripts/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,17 +255,19 @@ $(document).ready(function () {
};

if (object && object.type !== "note") query.select = object.type + object.id; // can't select notes
sendRemoteEditCommand(remoteEditHost + "/load_and_zoom?" + Qs.stringify(query), function () {
sendRemoteEditCommand(remoteEditHost + "/load_and_zoom?" + Qs.stringify(query), true, function () {
if (object && object.type === "note") {
var noteQuery = { url: osmHost + OSM.apiUrl(object) };
sendRemoteEditCommand(remoteEditHost + "/import?" + Qs.stringify(noteQuery));
sendRemoteEditCommand(remoteEditHost + "/import?" + Qs.stringify(noteQuery), false);
}
});

function sendRemoteEditCommand(url, callback) {
function sendRemoteEditCommand(url, displayError, callback) {
var iframe = $("<iframe>");
var timeoutId = setTimeout(function () {
alert(I18n.t("site.index.remote_failed"));
if (displayError) {
alert(I18n.t("site.index.remote_failed"));
}
iframe.remove();
}, 5000);

Expand Down

0 comments on commit 8482a2d

Please sign in to comment.