Fix Quest download filename and simplify fetch
This commit is contained in:
@@ -292,14 +292,6 @@ footer .about * {
|
|||||||
Responsive
|
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) {
|
@media (min-width: 768px) and (max-width: 979px) {
|
||||||
.jumbotron {
|
.jumbotron {
|
||||||
margin-top: -20px;
|
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";
|
import { getLatestDownloads } from "$lib/downloads";
|
||||||
|
|
||||||
const latestDownloads = await getLatestDownloads();
|
const downloads = await getLatestDownloads();
|
||||||
const downloads = latestDownloads.success ? latestDownloads.data : [];
|
|
||||||
|
|
||||||
const defaultDownload = downloads[0];
|
const defaultDownload = downloads[0];
|
||||||
---
|
---
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ type DownloadPlatformConfig = {
|
|||||||
label: string;
|
label: string;
|
||||||
icon: ImageMetadata;
|
icon: ImageMetadata;
|
||||||
versionKey: keyof LatestBuildsResponse;
|
versionKey: keyof LatestBuildsResponse;
|
||||||
|
fileNameOverride?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const downloadPlatforms: DownloadPlatformConfig[] = [
|
export const downloadPlatforms: DownloadPlatformConfig[] = [
|
||||||
@@ -41,31 +42,34 @@ export const downloadPlatforms: DownloadPlatformConfig[] = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
platform: "meta",
|
platform: "meta",
|
||||||
label: "Meta Quest",
|
label: "Oculus Quest",
|
||||||
icon: metaIcon,
|
icon: metaIcon,
|
||||||
versionKey: "latestMetaVersion",
|
versionKey: "latestMetaVersion",
|
||||||
|
fileNameOverride: "android.apk"
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
export const buildDownloadOptions = (
|
export const buildDownloadOptions = (
|
||||||
latestVersions: LatestBuildsResponse,
|
latestVersions: LatestBuildsResponse,
|
||||||
): DownloadOption[] =>
|
): DownloadOption[] =>
|
||||||
downloadPlatforms.map(({ platform, label, icon, versionKey }) => {
|
downloadPlatforms.map(({ platform, label, icon, versionKey, fileNameOverride }) => {
|
||||||
const version = latestVersions[versionKey];
|
const version = latestVersions[versionKey];
|
||||||
|
|
||||||
|
const fileName = fileNameOverride ? fileNameOverride : `${platform}.zip`;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
platform,
|
platform,
|
||||||
label,
|
label,
|
||||||
version,
|
version,
|
||||||
href: `${TWY_CDN_URL}/builds/${encodeURIComponent(version)}/${platform}.zip`,
|
href: `${TWY_CDN_URL}/builds/${encodeURIComponent(version)}/${fileName}`,
|
||||||
icon,
|
icon,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
export const getLatestDownloads = async (): Promise<ApiResult<DownloadOption[]>> => {
|
export const getLatestDownloads = async (): Promise<DownloadOption[]> => {
|
||||||
const latestVersions = await api.builds.v1.getLatestVersions();
|
const latestVersions = await api.builds.v1.getLatestVersions();
|
||||||
if (!latestVersions.success)
|
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";
|
import Layout from "$layouts/Layout.astro";
|
||||||
|
|
||||||
const latestDownloads = await getLatestDownloads();
|
const downloads = await getLatestDownloads();
|
||||||
const downloads = latestDownloads.success ? latestDownloads.data : [];
|
|
||||||
|
|
||||||
const patchNotes = await api.builds.v1.getPatchNotes();
|
const patchNotes = await api.builds.v1.getPatchNotes();
|
||||||
---
|
---
|
||||||
|
|||||||
Reference in New Issue
Block a user