Skip to content

Commit 36af00c

Browse files
committed
refactor: use download script in download.astro
1 parent f912d8e commit 36af00c

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

src/pages/download.astro

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,6 @@ import ProseCard from "../components/ui/ProseCard.astro";
1818
</MainLayout>
1919

2020
<script>
21-
const { userAgent, platform } = navigator;
22-
const ua = userAgent.toLowerCase();
23-
const p = platform.toLowerCase();
24-
25-
if (ua.includes("windows") || p.includes("win")) {
26-
window.location.href = "/download/windows";
27-
} else if (ua.includes("mac") || p.includes("mac")) {
28-
window.location.href = "/download/macos";
29-
} else {
30-
window.location.href = "/download/linux";
31-
}
21+
import { determineDownloadLink } from "../scripts/downloads";
22+
window.location.href = determineDownloadLink();
3223
</script>

0 commit comments

Comments
 (0)