You've already forked AstralRinth
forked from didirus/AstralRinth
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:
committed by
GitHub
parent
362fc11c81
commit
6f485d62ad
@@ -19,7 +19,6 @@ import Checkbox from "~/components/ui/Checkbox.vue";
|
|||||||
import { homePageProjects } from "~/generated/state.json";
|
import { homePageProjects } from "~/generated/state.json";
|
||||||
|
|
||||||
const os = ref(null);
|
const os = ref(null);
|
||||||
const macValue = ref(null);
|
|
||||||
const downloadWindows = ref(null);
|
const downloadWindows = ref(null);
|
||||||
const downloadLinux = ref(null);
|
const downloadLinux = ref(null);
|
||||||
const downloadSection = ref(null);
|
const downloadSection = ref(null);
|
||||||
@@ -31,8 +30,7 @@ const linuxLinks = {
|
|||||||
thirdParty: "https://support.modrinth.com/en/articles/9298760",
|
thirdParty: "https://support.modrinth.com/en/articles/9298760",
|
||||||
};
|
};
|
||||||
const macLinks = {
|
const macLinks = {
|
||||||
appleSilicon: null,
|
universal: null,
|
||||||
intel: null,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
let downloadLauncher;
|
let downloadLauncher;
|
||||||
@@ -53,8 +51,7 @@ const [{ data: launcherUpdates }] = await Promise.all([
|
|||||||
),
|
),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
macLinks.appleSilicon = launcherUpdates.value.platforms["darwin-aarch64"].install_urls[0];
|
macLinks.universal = launcherUpdates.value.platforms["darwin-aarch64"].install_urls[0];
|
||||||
macLinks.intel = launcherUpdates.value.platforms["darwin-x86_64"].install_urls[0];
|
|
||||||
windowsLink.value = launcherUpdates.value.platforms["windows-x86_64"].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.appImage = launcherUpdates.value.platforms["linux-x86_64"].install_urls[1];
|
||||||
linuxLinks.deb = launcherUpdates.value.platforms["linux-x86_64"].install_urls[0];
|
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 = () => {
|
const scrollToSection = () => {
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
window.scrollTo({
|
window.scrollTo({
|
||||||
@@ -834,13 +813,9 @@ useSeoMeta({
|
|||||||
Mac
|
Mac
|
||||||
</div>
|
</div>
|
||||||
<div class="description apple">
|
<div class="description apple">
|
||||||
<a :href="macLinks.appleSilicon" download="">
|
<a :href="macLinks.universal" download="">
|
||||||
<DownloadIcon />
|
<DownloadIcon />
|
||||||
<span> Download for Apple Silicon </span>
|
<span> Download the beta </span>
|
||||||
</a>
|
|
||||||
<a :href="macLinks.intel" download="">
|
|
||||||
<DownloadIcon />
|
|
||||||
<span> Download for Intel </span>
|
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user