Fix Quest download filename and simplify fetch
This commit is contained in:
@@ -292,14 +292,6 @@ footer .about * {
|
||||
Responsive
|
||||
========================================================================== */
|
||||
|
||||
@media only screen and (-webkit-min-device-pixel-ratio: 2),
|
||||
only screen and (min--moz-device-pixel-ratio: 2),
|
||||
only screen and (-o-min-device-pixel-ratio: 2/1) {
|
||||
.jumbotron:after {
|
||||
background-size: 150px 150px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 768px) and (max-width: 979px) {
|
||||
.jumbotron {
|
||||
margin-top: -20px;
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 7.0 MiB After Width: | Height: | Size: 15 MiB |
@@ -1,8 +1,7 @@
|
||||
---
|
||||
import { getLatestDownloads } from "$lib/downloads";
|
||||
|
||||
const latestDownloads = await getLatestDownloads();
|
||||
const downloads = latestDownloads.success ? latestDownloads.data : [];
|
||||
const downloads = await getLatestDownloads();
|
||||
|
||||
const defaultDownload = downloads[0];
|
||||
---
|
||||
|
||||
@@ -24,6 +24,7 @@ type DownloadPlatformConfig = {
|
||||
label: string;
|
||||
icon: ImageMetadata;
|
||||
versionKey: keyof LatestBuildsResponse;
|
||||
fileNameOverride?: string;
|
||||
};
|
||||
|
||||
export const downloadPlatforms: DownloadPlatformConfig[] = [
|
||||
@@ -41,31 +42,34 @@ export const downloadPlatforms: DownloadPlatformConfig[] = [
|
||||
},
|
||||
{
|
||||
platform: "meta",
|
||||
label: "Meta Quest",
|
||||
label: "Oculus Quest",
|
||||
icon: metaIcon,
|
||||
versionKey: "latestMetaVersion",
|
||||
fileNameOverride: "android.apk"
|
||||
},
|
||||
];
|
||||
|
||||
export const buildDownloadOptions = (
|
||||
latestVersions: LatestBuildsResponse,
|
||||
): DownloadOption[] =>
|
||||
downloadPlatforms.map(({ platform, label, icon, versionKey }) => {
|
||||
downloadPlatforms.map(({ platform, label, icon, versionKey, fileNameOverride }) => {
|
||||
const version = latestVersions[versionKey];
|
||||
|
||||
const fileName = fileNameOverride ? fileNameOverride : `${platform}.zip`;
|
||||
|
||||
return {
|
||||
platform,
|
||||
label,
|
||||
version,
|
||||
href: `${TWY_CDN_URL}/builds/${encodeURIComponent(version)}/${platform}.zip`,
|
||||
href: `${TWY_CDN_URL}/builds/${encodeURIComponent(version)}/${fileName}`,
|
||||
icon,
|
||||
};
|
||||
});
|
||||
|
||||
export const getLatestDownloads = async (): Promise<ApiResult<DownloadOption[]>> => {
|
||||
export const getLatestDownloads = async (): Promise<DownloadOption[]> => {
|
||||
const latestVersions = await api.builds.v1.getLatestVersions();
|
||||
if (!latestVersions.success)
|
||||
return ApiResult.failure<DownloadOption[]>(latestVersions.error);
|
||||
return [];
|
||||
|
||||
return ApiResult.success(buildDownloadOptions(latestVersions.data));
|
||||
return buildDownloadOptions(latestVersions.data);
|
||||
};
|
||||
@@ -6,8 +6,7 @@ import { getLatestDownloads } from "$lib/downloads";
|
||||
|
||||
import Layout from "$layouts/Layout.astro";
|
||||
|
||||
const latestDownloads = await getLatestDownloads();
|
||||
const downloads = latestDownloads.success ? latestDownloads.data : [];
|
||||
const downloads = await getLatestDownloads();
|
||||
|
||||
const patchNotes = await api.builds.v1.getPatchNotes();
|
||||
---
|
||||
|
||||
Reference in New Issue
Block a user