diff options
author | Anton Tananaev <anton@traccar.org> | 2022-07-04 14:29:33 -0700 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2022-07-04 14:29:33 -0700 |
commit | f66fca5d39b2bb3684cbaee3e023d32c4252be3f (patch) | |
tree | 9085e396ed92eddf8989c6d9251ce514212d0fc9 /modern/src/other/ReplayPage.js | |
parent | 88514a2ff053490b4342caeeaf5abf13355fc5d8 (diff) | |
download | trackermap-web-f66fca5d39b2bb3684cbaee3e023d32c4252be3f.tar.gz trackermap-web-f66fca5d39b2bb3684cbaee3e023d32c4252be3f.tar.bz2 trackermap-web-f66fca5d39b2bb3684cbaee3e023d32c4252be3f.zip |
Simplify KML export
Diffstat (limited to 'modern/src/other/ReplayPage.js')
-rw-r--r-- | modern/src/other/ReplayPage.js | 11 |
1 files changed, 3 insertions, 8 deletions
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 ( <div className={classes.root}> |