Simplify Mac app download links (#3519)

* tweak(frontend/app): simplify download links, remove dead code

* chore: apply @triphora's suggestion

Co-authored-by: Emma Alexia <emma@modrinth.com>
Signed-off-by: Alejandro González <7822554+AlexTMjugador@users.noreply.github.com>

---------

Signed-off-by: Alejandro González <7822554+AlexTMjugador@users.noreply.github.com>
Co-authored-by: Emma Alexia <emma@modrinth.com>
This commit is contained in:
Alejandro González 2025-04-28 01:03:13 +02:00 committed by GitHub
parent 362fc11c81
commit 6f485d62ad
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -19,7 +19,6 @@ import Checkbox from "~/components/ui/Checkbox.vue";
import { homePageProjects } from "~/generated/state.json";
const os = ref(null);
const macValue = ref(null);
const downloadWindows = ref(null);
const downloadLinux = ref(null);
const downloadSection = ref(null);
@ -31,8 +30,7 @@ const linuxLinks = {
thirdParty: "https://support.modrinth.com/en/articles/9298760",
};
const macLinks = {
appleSilicon: null,
intel: null,
universal: null,
};
let downloadLauncher;
@ -53,8 +51,7 @@ const [{ data: launcherUpdates }] = await Promise.all([
),
]);
macLinks.appleSilicon = launcherUpdates.value.platforms["darwin-aarch64"].install_urls[0];
macLinks.intel = launcherUpdates.value.platforms["darwin-x86_64"].install_urls[0];
macLinks.universal = launcherUpdates.value.platforms["darwin-aarch64"].install_urls[0];
windowsLink.value = launcherUpdates.value.platforms["windows-x86_64"].install_urls[0];
linuxLinks.appImage = launcherUpdates.value.platforms["linux-x86_64"].install_urls[1];
linuxLinks.deb = launcherUpdates.value.platforms["linux-x86_64"].install_urls[0];
@ -85,24 +82,6 @@ onMounted(() => {
}
});
watch(macValue, () => {
if (macValue.value === "Download for Apple Silicon") {
const link = document.createElement("a");
link.href = macLinks.appleSilicon;
link.download = "";
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
} else if (macValue.value === "Download for Intel") {
const link = document.createElement("a");
link.href = macLinks.intel;
link.download = "";
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
}
});
const scrollToSection = () => {
nextTick(() => {
window.scrollTo({
@ -834,13 +813,9 @@ useSeoMeta({
Mac
</div>
<div class="description apple">
<a :href="macLinks.appleSilicon" download="">
<a :href="macLinks.universal" download="">
<DownloadIcon />
<span> Download for Apple Silicon </span>
</a>
<a :href="macLinks.intel" download="">
<DownloadIcon />
<span> Download for Intel </span>
<span> Download the beta </span>
</a>
</div>
</div>