From: Anton Khorev Date: Tue, 25 Oct 2022 08:45:43 +0000 (+0300) Subject: Don't display error messages when second scheduled rc command fails X-Git-Tag: live~179^2~1 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/38a8a57a90cceacce0e4f4ce83cc60c77b372ece?ds=inline;hp=d91a7cbf97c797952579c3bf0e46578b8cee98cd Don't display error messages when second scheduled rc command fails --- diff --git a/app/assets/javascripts/index.js b/app/assets/javascripts/index.js index 0fa85a0cc..6e3e3cea2 100644 --- a/app/assets/javascripts/index.js +++ b/app/assets/javascripts/index.js @@ -241,15 +241,15 @@ $(document).ready(function () { const noteQuery = new URLSearchParams({ url: osmHost + OSM.apiUrl(object) }); sendRemoteEditCommand(remoteEditHost + "/import?" + noteQuery); } + }, function () { + // eslint-disable-next-line no-alert + alert(I18n.t("site.index.remote_failed")); }); - function sendRemoteEditCommand(url, callback) { + function sendRemoteEditCommand(url, callback, errorCallback) { fetch(url, { mode: "no-cors", signal: AbortSignal.timeout(5000) }) .then(callback) - .catch(function () { - // eslint-disable-next-line no-alert - alert(I18n.t("site.index.remote_failed")); - }); + .catch(errorCallback); } return false;