Compare commits

...

2 Commits

Author SHA1 Message Date
jduncanator 6edd6ca668 view/download: Remove unnecessary type 2024-03-21 18:13:23 +11:00
jduncanator c1dd2e517e view/download: Only calculate the total for the latest release 2024-03-21 18:12:29 +11:00
1 changed files with 2 additions and 7 deletions

View File

@ -10,7 +10,6 @@ import {
} from "@heroicons/vue/solid";
import { DownloadAsset, DownloadRelease } from "@/types";
import { assert } from "console";
const GUIDE_URL = import.meta.env.VITE_GUIDE_URL as string;
const LDN_BUILD_URL = import.meta.env.VITE_LDN_BUILD_URL as string;
@ -40,12 +39,8 @@ onMounted(() => {
});
const totalDownload = computed(() => {
return downloadReleases.value?.reduce(
(sumTotal, release: DownloadRelease) => {
const total = release.assets.reduce((total, asset: DownloadAsset) => total + asset.download_count, 0);
return sumTotal + total;
}, 0) ?? 0;
return downloadReleases.value[0]
.assets.reduce((total, asset) => total + asset.download_count, 0)
});
const fetchBuilds = async () => {