[openstreetmap/openstreetmap-website] Map XML download with Turbo (PR #6255)

mmd notifications at github.com
Sun Jul 27 09:13:18 UTC 2025


@mmd-osm commented on this pull request.



> +      try {
+        detailMessage = event?.detail?.error?.message;
+        if (!detailMessage) {
+          const responseText = await event.detail.fetchResponse.responseText;
+          const parser = new DOMParser();
+          const doc = parser.parseFromString(responseText, "text/html");
+          detailMessage = doc.body ? doc.body.textContent.trim() : "(unknown)";
+        }
+      } catch (err) {
+        detailMessage = "(unknown)";
+      }
+      // eslint-disable-next-line no-alert
+      alert(OSM.i18n.t("javascripts.share.export_failed", { reason: detailMessage }));
+    }
+
+    static getTurboBlobHandler(downloadCallback) {

Well in this case, we could also replace the callback in handleExportSuccess by the filename, and simply call OSM.downloadBlob right there.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6255#discussion_r2233877656
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/6255/review/3059427831 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20250727/ca4fd219/attachment.htm>


More information about the rails-dev mailing list