From f66fca5d39b2bb3684cbaee3e023d32c4252be3f Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Mon, 4 Jul 2022 14:29:33 -0700 Subject: Simplify KML export --- modern/src/other/ReplayPage.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'modern/src/other') diff --git a/modern/src/other/ReplayPage.js b/modern/src/other/ReplayPage.js index a7d5ad49..7db751b2 100644 --- a/modern/src/other/ReplayPage.js +++ b/modern/src/other/ReplayPage.js @@ -140,15 +140,10 @@ const ReplayPage = () => { } }); - const handleDownload = useCatch(async () => { + const handleDownload = () => { const query = new URLSearchParams({ deviceId: selectedDeviceId, from, to }); - const response = await fetch(`/api/positions/kml?${query.toString()}`); - if (response.ok) { - window.location.assign(window.URL.createObjectURL(await response.blob())); - } else { - throw Error(await response.text()); - } - }); + window.location.assign(`/api/positions/kml?${query.toString()}`); + }; return (
-- cgit v1.2.3