Merge remote-tracking branch 'upstream/pull/3767'
This commit is contained in:
commit
00108bc9b7
1 changed files with 13 additions and 13 deletions
|
@ -236,20 +236,20 @@ $(document).ready(function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
if (object && object.type !== "note") query.set("select", object.type + object.id); // can't select notes
|
if (object && object.type !== "note") query.set("select", object.type + object.id); // can't select notes
|
||||||
sendRemoteEditCommand(remoteEditHost + "/load_and_zoom?" + query, function () {
|
sendRemoteEditCommand(remoteEditHost + "/load_and_zoom?" + query)
|
||||||
|
.then(() => {
|
||||||
if (object && object.type === "note") {
|
if (object && object.type === "note") {
|
||||||
const noteQuery = new URLSearchParams({ url: osmHost + OSM.apiUrl(object) });
|
const noteQuery = new URLSearchParams({ url: osmHost + OSM.apiUrl(object) });
|
||||||
sendRemoteEditCommand(remoteEditHost + "/import?" + noteQuery);
|
sendRemoteEditCommand(remoteEditHost + "/import?" + noteQuery);
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
|
.catch(() => {
|
||||||
function sendRemoteEditCommand(url, callback) {
|
|
||||||
fetch(url, { mode: "no-cors", signal: AbortSignal.timeout(5000) })
|
|
||||||
.then(callback)
|
|
||||||
.catch(function () {
|
|
||||||
// eslint-disable-next-line no-alert
|
// eslint-disable-next-line no-alert
|
||||||
alert(I18n.t("site.index.remote_failed"));
|
alert(I18n.t("site.index.remote_failed"));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function sendRemoteEditCommand(url) {
|
||||||
|
return fetch(url, { mode: "no-cors", signal: AbortSignal.timeout(5000) });
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue