Show build versions in downloads
This commit is contained in:
@@ -75,6 +75,6 @@ const defaultDownload = downloads[0];
|
||||
$downloadButton
|
||||
.attr("href", download.href)
|
||||
.attr("aria-label", `Download TenWholeYears for ${download.label}`)
|
||||
.text(`Download for ${download.label}`);
|
||||
.text(`Download for ${download.label} (${download.version})`);
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -2,7 +2,6 @@ import { TWY_CDN_URL } from "astro:env/server";
|
||||
|
||||
import { api } from "$lib/api";
|
||||
|
||||
import { ApiResult } from "$lib/types/api";
|
||||
import type { LatestBuildsResponse } from "$lib/types/api/builds";
|
||||
|
||||
import windowsIcon from "$assets/images/platforms/platform-windows.png";
|
||||
@@ -52,8 +51,10 @@ export const downloadPlatforms: DownloadPlatformConfig[] = [
|
||||
export const buildDownloadOptions = (
|
||||
latestVersions: LatestBuildsResponse,
|
||||
): DownloadOption[] =>
|
||||
downloadPlatforms.map(({ platform, label, icon, versionKey, fileNameOverride }) => {
|
||||
const version = latestVersions[versionKey];
|
||||
downloadPlatforms
|
||||
.filter(({ versionKey }) => latestVersions[versionKey] != null)
|
||||
.map(({ platform, label, icon, versionKey, fileNameOverride }) => {
|
||||
const version = latestVersions[versionKey]!;
|
||||
|
||||
const fileName = fileNameOverride ? fileNameOverride : `${platform}.zip`;
|
||||
|
||||
@@ -72,4 +73,4 @@ export const getLatestDownloads = async (): Promise<DownloadOption[]> => {
|
||||
return [];
|
||||
|
||||
return buildDownloadOptions(latestVersions.data);
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
export interface LatestBuildsResponse {
|
||||
latestWindowsVersion: string;
|
||||
latestLinuxVersion: string;
|
||||
latestMetaVersion: string;
|
||||
latestWindowsVersion: string | null;
|
||||
latestLinuxVersion: string | null;
|
||||
latestMetaVersion: string | null;
|
||||
}
|
||||
|
||||
export interface PatchNote {
|
||||
|
||||
Reference in New Issue
Block a user